I've read about 50 posts regarding passing a value from one form to another, and I Just don't get it!
I have a table of zipcodes which I use to autofill city and state fields. The Zipcode is entered into txtCoZip. If the zipcode is in the table it autofills, but if the zipcode is not in the table, a form opens to add it to the table. OpenArgs seems to be the answer to this, but I can't quite follow it all the way through. This is the code I'm using to open the form:
This is the code I'm using on the onOpen event of frmAddZipcode:
I'm getting an error "you cannot assign a value to this object'.
What am I doing wrong?
Thanks,
Sup
I have a table of zipcodes which I use to autofill city and state fields. The Zipcode is entered into txtCoZip. If the zipcode is in the table it autofills, but if the zipcode is not in the table, a form opens to add it to the table. OpenArgs seems to be the answer to this, but I can't quite follow it all the way through. This is the code I'm using to open the form:
Code:
DoCmd.OpenForm "frmAddZipcode", OpenArgs:=Me.txtCoZip
This is the code I'm using on the onOpen event of frmAddZipcode:
Code:
If Not IsNull(Me.OpenArgs) Then
Me.ZipCode = Me.OpenArgs
End If
I'm getting an error "you cannot assign a value to this object'.
What am I doing wrong?
Thanks,
Sup