Selasa, 27 Maret 2012

RE: [MS_AccessPros] Too few parameters

 

IDPegSource is a number?
UserName is text?

Try this
"WHERE [T_XPWD].UserName=" &""& [Forms]![ZZ_TAMBAH USER]![Text0] &
""&";"

Need to wrap the textbox value in quotes.

Bob Peterson

-----Original Message-----
From: MS_Access_Professionals@yahoogroups.com
[mailto:MS_Access_Professionals@yahoogroups.com] On Behalf Of
agesthahendra@ymail.com
Sent: Tuesday, March 27, 2012 10:16 AM
To: MS_Access_Professionals@yahoogroups.com
Subject: [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

------------------------------------

Yahoo! Groups Links

__._,_.___
Recent Activity:
.

__,_._,___

Tidak ada komentar:

Posting Komentar