G
Guest
I have a form where Invoice information is entered into a subform. If an
Operation Code (OpCode) is entered into the dropdown that is not in the list
a form is opened to a new record so that the new Code can be entered with a
description using NotInList. This works fine. What I would like to do is
autopopulate the new record with the OpCode that was entered. I have tried
creating a variable stOpData. Here's my code
Dim stOpData As String
stOpData = me.[Operation]
stDocName = "Operation Codes"
DoCmd.OpenForm stDocName
DoCmd.GoToRecord , , acNewRec
[Forms]![Operation Codes]![Operation Code] = stOpData
It works if the variable is hard coded eg: stOpData = "00-904" but using
the control this way I get an "Invalid use of null" error
Any help would be greatly appreciated,
Thanks in Advance,
Pip'n
Operation Code (OpCode) is entered into the dropdown that is not in the list
a form is opened to a new record so that the new Code can be entered with a
description using NotInList. This works fine. What I would like to do is
autopopulate the new record with the OpCode that was entered. I have tried
creating a variable stOpData. Here's my code
Dim stOpData As String
stOpData = me.[Operation]
stDocName = "Operation Codes"
DoCmd.OpenForm stDocName
DoCmd.GoToRecord , , acNewRec
[Forms]![Operation Codes]![Operation Code] = stOpData
It works if the variable is hard coded eg: stOpData = "00-904" but using
the control this way I get an "Invalid use of null" error
Any help would be greatly appreciated,
Thanks in Advance,
Pip'n