CallMeAndy
Registered User.
- Local time
- Today, 09:10
- Joined
- Jun 21, 2005
- Messages
- 14
Private Sub City_NotInList(NewData As String, Response As Integer)
DoCmd.OpenForm "City", , , , acFormAdd, acDialog, NewData
Response = acDataErrAdded
End Sub
Private Sub Form_Open(Cancel As Integer)
If Me.OpenArgs <> "" Then 'It has been opened for new records only
CityName = Me.OpenArgs
End If
End Sub
I've tried this on the forms current event with added condition of
Me.NewRecord and with fully qualified name for CityName
The form opens OK but the field is always blank - when the trace passes through the CityName assignment though, it makes the assignment successfully according to the value shown on hovering over the variable in the VBA editor.
Any comments much appreciated
DoCmd.OpenForm "City", , , , acFormAdd, acDialog, NewData
Response = acDataErrAdded
End Sub
Private Sub Form_Open(Cancel As Integer)
If Me.OpenArgs <> "" Then 'It has been opened for new records only
CityName = Me.OpenArgs
End If
End Sub
I've tried this on the forms current event with added condition of
Me.NewRecord and with fully qualified name for CityName
The form opens OK but the field is always blank - when the trace passes through the CityName assignment though, it makes the assignment successfully according to the value shown on hovering over the variable in the VBA editor.
Any comments much appreciated