Hmm!
I found one thing in the code I posted to you which wasn´t right. I didn´t
dim variable <strWhereCategory> at all. It should look like this (see below)
and goes in top of the fom´s open_event code module:
*************************
Dim strWhereCategory as String
*************************
Maby that might help you? If not please keep on reading:
I don´t quit follow you!
Is the complete code which goes in the forms open:__event (the form which
you try to open but have problem with) realy only:
*************************************************
Private Sub Form_Open(Cancel As Integer)
Dim passid As String
passid = Forms![EmployeeDialogForm]![EmployeeID]
End Sub
****************************************************
Question:
1.) What do you do with the value in variable <passid>???
1a) Is <passid> a name of a control in the form?
2.) If you do have more code in the form´s open_event accept the one above
please post it as well.
3.) How about the complete code from where you try to open up the form,
please post the complete code exactly the way it looks like.
The code to open up a form where you have an integer in criteria is:
****************************************************************
Dim intYourVariableNameHoldingANumber as Integer
Dim strWhereCategory as String
strWhereCategory = "[EmployeeID ]=" & intYourVariableNameHoldingANumber
DoCmd.OpenForm "frmNewEmp", acNormal, , strWhereCategory
****************************************************************
The code to use if you use a string variable is:
===========================================================
Dim strYourVariableNameHoldingANumber as Stringr
Dim strWhereCategory as String
strWhereCategory = "[EmployeeID ]= 'strYourVariableNameHoldingANumber'"
DoCmd.OpenForm "frmNewEmp", acNormal, , strWhereCategory
===========================================================
If this doesn´t help you please answer the Q above!
// Niklas
JMorrell said:
The form's open event is Form_Current() the very start of which is :
Dim passid As String
passid = Forms![EmployeeDialogForm]![EmployeeID]
where the previous form is EmployeeDialogForm,
and the field I'm passing to the new field is a value from that form, not a "field" or "control".
In the Expression Watch area in debug mode, EmployeeID still has a value
in the new form, so I believe that it's available to me. I just haven't
gotten the syntax right yet. I should add that the passed value
(EmployeeID) is a string type value.