Selasa, 19 Februari 2019

[MS_AccessPros] Open a recordset question

 

Hello all,

I seemingly need to do something really simple but I have spent 5 hours on this. searching the internet for solutions. But nothing helps me.

I am trying to open a recordset or even just a table with criteria from a form.


But I keep getting errors. currently the error is Too few parameters. Expected 1. runtime error 3061


My code right now after many iterations is below


I must be doing something wrong or there is a bug.

can someone point me in the right direction Please.


Thank you


Jim Wagner


Private Sub Command32_Click()

Dim rs As DAO.Recordset
Dim strSQL As String
Dim db As DAO.Database



Set db = CurrentDb


strSQL = "SELECT AccountCodesForTimesheets.[Position Nbr], * FROM AccountCodesForTimesheets WHERE (((AccountCodesForTimesheets.[Position Nbr])=[Forms]![frmAccountCodesForTimesheetsValidationForm]![txtPosCd]));"
Set rs = CurrentDb.OpenRecordset(strSQL)

DoCmd.OpenQuery strSQL, acViewNormal, acReadOnly



End Sub

__._,_.___

Posted by: luvmymelody@yahoo.com
Reply via web post Reply to sender Reply to group Start a New Topic Messages in this topic (1)

Have you tried the highest rated email app?
With 4.5 stars in iTunes, the Yahoo Mail app is the highest rated email app on the market. What are you waiting for? Now you can access all your inboxes (Gmail, Outlook, AOL and more) in one place. Never delete an email again with 1000GB of free cloud storage.


SPONSORED LINKS
.

__,_._,___

Tidak ada komentar:

Posting Komentar