J
Jenna Baze
Hello - I'm wondering if anyone else has run into this problem, or knows how
to fix it.
When I attempt to use the command button wizard to create a button that
opens a form based on a foreign key.
I've been running into this repeatedly with other forms. I'm working on a db
that was created in Access 2003, and I'm using 2007 with it now. I'm not
sure if that is causing the problem.
Problem: In the "Which fields contain matching data..." screen where you can
link the two, the form that I am working on does not show any fields that I
can select.
When I do the coding in vba, it doesn't find the record. (This worked fine
previously.)
My code appears below. It runs properly as far as opening the form, but it
isn't recognizing the field and gives me a msgbox saying "There are no
matching records", which I've created on the frmProject if there are < 1
records in the recordset.
' Open project form, if it exists
If IsNull(Me.EstProjectNum) Then
Exit Sub
Else ' Is an project number
Dim stLinkCriteria As String
Dim stDocName As String
stDocName = "frmProject"
stLinkCriteria = "[ProjNum]=" & "'" & Me![EstProjectNum] & "'"
DoCmd.openForm stDocName, , , stLinkCriteria
End If
So, my main question is: how can I get the "Which fields contain matching
data..." dialog to go back to showing the fields on this form, instead of
being blank?
Thanks in advance for any advice.
SubyRuby
to fix it.
When I attempt to use the command button wizard to create a button that
opens a form based on a foreign key.
I've been running into this repeatedly with other forms. I'm working on a db
that was created in Access 2003, and I'm using 2007 with it now. I'm not
sure if that is causing the problem.
Problem: In the "Which fields contain matching data..." screen where you can
link the two, the form that I am working on does not show any fields that I
can select.
When I do the coding in vba, it doesn't find the record. (This worked fine
previously.)
My code appears below. It runs properly as far as opening the form, but it
isn't recognizing the field and gives me a msgbox saying "There are no
matching records", which I've created on the frmProject if there are < 1
records in the recordset.
' Open project form, if it exists
If IsNull(Me.EstProjectNum) Then
Exit Sub
Else ' Is an project number
Dim stLinkCriteria As String
Dim stDocName As String
stDocName = "frmProject"
stLinkCriteria = "[ProjNum]=" & "'" & Me![EstProjectNum] & "'"
DoCmd.openForm stDocName, , , stLinkCriteria
End If
So, my main question is: how can I get the "Which fields contain matching
data..." dialog to go back to showing the fields on this form, instead of
being blank?
Thanks in advance for any advice.
SubyRuby