hockeylvr
Technical User
- Nov 26, 2002
- 140
I'm sure I posted this last week but it is no where on the forum to be found so I'm trying again.
I am trying to do a simple thing with stLinkCriteria and it simply will not work. I am getting the error "..Access cannot find the field 'clientid' referred to".
Private Sub Command2_Click()
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "frmnotes"
stLinkCriteria = "[clientid]= " & Me![clientid]
DoCmd.OpenForm stDocName, , , stLinkCriteria
All I'm trying to do is select a client from my combo box on frmclients, hit my command button and have frmnotes open with the details based on the clientid chosen in frmclients.
frmclients combo box - Unbound - SELECT tblclients.clientid, tblclients.lname & ", " & tblclients.fname FROM tblclients;
clientid in tblclients is an autonumber and type "number" in tblnotes.
frmnotes is based on qrynotes - sql below
SELECT tblnotes.clientid, tblclients.lname, tblclients.fname, tblnotes.notedate, tblnotes.note
FROM tblclients INNER JOIN tblnotes ON tblclients.clientid = tblnotes.clientid;
Would appreciate any ideas on what simple item I'm missing in my coding.
Thanks!
I am trying to do a simple thing with stLinkCriteria and it simply will not work. I am getting the error "..Access cannot find the field 'clientid' referred to".
Private Sub Command2_Click()
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "frmnotes"
stLinkCriteria = "[clientid]= " & Me![clientid]
DoCmd.OpenForm stDocName, , , stLinkCriteria
All I'm trying to do is select a client from my combo box on frmclients, hit my command button and have frmnotes open with the details based on the clientid chosen in frmclients.
frmclients combo box - Unbound - SELECT tblclients.clientid, tblclients.lname & ", " & tblclients.fname FROM tblclients;
clientid in tblclients is an autonumber and type "number" in tblnotes.
frmnotes is based on qrynotes - sql below
SELECT tblnotes.clientid, tblclients.lname, tblclients.fname, tblnotes.notedate, tblnotes.note
FROM tblclients INNER JOIN tblnotes ON tblclients.clientid = tblnotes.clientid;
Would appreciate any ideas on what simple item I'm missing in my coding.
Thanks!