K
Ken
Hi and Thanks in advance for looking at this
It would be helpful if I could open a form using a string
criteria. However, I have been unsuccessful in my efforts
so far. I have tried using the help files but I invariably
get one of two errors when I run the code. Access either
rejects the criteria and gives an Invalid Use of Null
error, or it evaluates the criteria and decides it is a
parameter and invokes a request for the user to enter the
parameter. I'm sure I'm not doing something right...please
help.
Public MyString as String
MyField = TextBox
Form is based on query
Test are run to validate data prior to opening the form
MyString = MyField.Value
Docmd.OpenForm "MyForm",,,"[StringField]='" & MyString &_
"'",,acWindowNormal
Can this be done? Or must it be done in some other way?
It would be helpful if I could open a form using a string
criteria. However, I have been unsuccessful in my efforts
so far. I have tried using the help files but I invariably
get one of two errors when I run the code. Access either
rejects the criteria and gives an Invalid Use of Null
error, or it evaluates the criteria and decides it is a
parameter and invokes a request for the user to enter the
parameter. I'm sure I'm not doing something right...please
help.
Public MyString as String
MyField = TextBox
Form is based on query
Test are run to validate data prior to opening the form
MyString = MyField.Value
Docmd.OpenForm "MyForm",,,"[StringField]='" & MyString &_
"'",,acWindowNormal
Can this be done? Or must it be done in some other way?