Selasa, 27 Maret 2012

[MS_AccessPros] Too few parameters

 

Hi Everyone....

I succesfully ran these codes in a form :

Dim db As Database
Dim rs As DAO.Recordset
Dim strSql As String
Set db = CurrentDb()
strSql = "SELECT [T_XCEK PEG].IDPeg_Source " & vbCrLf & _
"FROM [T_XCEK PEG] " & vbCrLf & _
"WHERE ((([T_XCEK PEG].IDPeg_Source)=" & [Forms]![1_DATA PEGAWAI]![IDPeg_Source] & "));"
Set rs = db.OpenRecordset(strSql)
' Bla bla bla...

Then i modified it and assign it on control on other form (diffrent Table Source):

Dim db As Database
Dim rs As DAO.Recordset
Dim strSql As String
Set db = CurrentDb()
strSql = "SELECT [T_XPWD].UserName " & vbCrLf & _
"FROM [T_XPWD] " & vbCrLf & _
"WHERE ((([T_XPWD].UserName)=" & [Forms]![ZZ_TAMBAH USER]![Text0] & "));"
Set rs = db.OpenRecordset(strSql)
' Bla bla bla

but it gives eroor : Too few parameters,,,
Please give me direction where the mistake is, they both codes look similiar to me..
Any explanation would be very appreciated

Regards
Hendra

__._,_.___
Recent Activity:
.

__,_._,___

Tidak ada komentar:

Posting Komentar