Hi TeeSee
Is "ctlFileNumber" the name of a field in the recordsource of
frmMSDSdataInput, or is it just the name of a control on that form?
It should be the name of a field in the recordsource.
If you have, for example, a textbox named ctlFileNumber and it has as its
controlsource a field named FileNumber, then your OpenForm where condition
should be:
"[FileNumber]=" & Me![FileNumber]
The [FileNumber] on the left is the name of the field in the recordsource of
the form you are opening and the one on the right is the name of the textbox
on the current form (frmSearch).
It will take the *value* in the textbox and append it to the "[FileNumber]="
string to give:
[FileNumber]=12345
Also note that if [FileNumber] is a text field you need to do it slightly
differently, otherwise you will get:
[FileNumber]=ABC99
and this will prompt for the undeclared parameter named "ABC99".
For text fields you must wrap the value in either single of double quote
marks:
Either
"[FileNumber]='" & Me![FileNumber] & "'"
or
"[FileNumber]=""" & Me![FileNumber] & """"
--
Good Luck
Graham Mandeno [Access MVP]
Auckland, New Zealand
You should execute an OpenForm command similar to the following:
DoCmd.OpenForm "Name of your form", , , "[IDNUM]=" & Me![IDNUM]
Graham ... A sincere thanks for the reponse. I still have the same
problem as follows. Actual field names!
The field [FileNumber] is the field on frmSearch to be double
clicked.
[ctlFileNumber] is on the form being opened.
Private Sub FileNumber_DblClick(Cancel As Integer)
DoCmd.OpenForm "frmMSDSdataInput", , , "[ctlFileNumber]=" & Me!
[FileNumber]
End Sub
Graham .. This is what I don't understand. I believe I have the syntax
correct as you described buy I still get a "Enter Parameter Value" box
looking for a value for [ctlFileNumber]
In the DoCmd line what I would like to understand is .... The position
of the first fieldname (in this case [ctlFileNumber]) is on the form
being opened and the second (Me![FileNumber]) refers to in my case the
search from which is the currently opened form.
Do I have this correct?
Why do you think I am getting the Enter Parameter Value
request.ingsterm- Hide quoted text -
- Show quoted text -