D
DowningDevelopments
Hello all,
I am using the Docmd.openform to open a form based on a selection that the
user makes from a list on the current form. this is the code im currently
using.
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "Gurantors"
stLinkCriteria = "[Postcode]=" & "'" & Me![POBOX1] & "'" & _
" And " & "[Postcode2]=" & "'" & Me![POBOX2] & "'" _
" And " & "[GuarantorDate]=" & "'" & Me![Gyear] & "'"
DoCmd.OpenForm stDocName, , , stLinkCriteria, acFormEdit
this causes an error which manifests itself as a message box telling me that
the form open was cancelled!
when i change the stlinkcriteria to just:
stLinkCriteria = "[Postcode]=" & "'" & Me![POBOX1] & "'" & _
" And " & "[Postcode2]=" & "'" & Me![POBOX2] & "'"
it works just fine but i need all three to make sure i get the right record.
whats making it go wrong when i add another argument?? Do i need to add
brakets??
Much thanks for looking at this problem,
Amit
I am using the Docmd.openform to open a form based on a selection that the
user makes from a list on the current form. this is the code im currently
using.
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "Gurantors"
stLinkCriteria = "[Postcode]=" & "'" & Me![POBOX1] & "'" & _
" And " & "[Postcode2]=" & "'" & Me![POBOX2] & "'" _
" And " & "[GuarantorDate]=" & "'" & Me![Gyear] & "'"
DoCmd.OpenForm stDocName, , , stLinkCriteria, acFormEdit
this causes an error which manifests itself as a message box telling me that
the form open was cancelled!
when i change the stlinkcriteria to just:
stLinkCriteria = "[Postcode]=" & "'" & Me![POBOX1] & "'" & _
" And " & "[Postcode2]=" & "'" & Me![POBOX2] & "'"
it works just fine but i need all three to make sure i get the right record.
whats making it go wrong when i add another argument?? Do i need to add
brakets??
Much thanks for looking at this problem,
Amit