Hi All,
I have a main form which is filled in and then I have added a button to move on to a second form. I wanted the ID from this first form to pass in to the second form as it opens.
I have used VBA to do this using OpenArgs as below:
For the button
and then as the form Main loads
This seems to be working well as it is passing a value through the problem is how the string is being read.
The ID is of the form "001", but the value that is being read into the second form is "1".
Both of the ID fields are short text and I know that OpenArgs is picking up a string so I thought it should be okay.
Does anyone have any advice on how to make sure the string is not represented as numeric?
Thanks,
Cydney
I have a main form which is filled in and then I have added a button to move on to a second form. I wanted the ID from this first form to pass in to the second form as it opens.
I have used VBA to do this using OpenArgs as below:
For the button
Private Sub Command25_Click()
DoCmd.OpenForm "Main", WhereCondition:="[Forms].[Main].[ID]=" & Me![Review_ID], WindowMode:=acDialog, OpenArgs:=Me.[Review_ID]
End Sub
and then as the form Main loads
Private Sub Form_Load()
If Me.OpenArgs <> "" Then
Me![ID].DefaultValue = "" & Me.[OpenArgs] & ""
End If
End Sub
This seems to be working well as it is passing a value through the problem is how the string is being read.
The ID is of the form "001", but the value that is being read into the second form is "1".
Both of the ID fields are short text and I know that OpenArgs is picking up a string so I thought it should be okay.
Does anyone have any advice on how to make sure the string is not represented as numeric?
Thanks,
Cydney