Richard1941
Registered User.
- Local time
- Yesterday, 20:01
- Joined
- Oct 29, 2012
- Messages
- 34
My form has a subform called subformDestinations that has one field Destinations. When I type in that field the record that is the record source for the main table gets updated correctly. Outside the subform there is a button to add the new value to a lookup table. I tried the following code in the click event:
Private Sub Command219_Click()
Dim strData As String '' Declare a String Variable
Dim sql As String '' sql String
strData = Me.Destinations
sql = "Insert into LUtblDestinations (Column1,FKID) Values (""" & strData & """);"
DoCmd.SetWarnings False
DoCmd.RunSQL sql
DoCmd.SetWarnings True
End Sub
However, the Me.Destinations causes Compile error: Method or data member not found. How do I refer to the data I want to use to update the other table?
Private Sub Command219_Click()
Dim strData As String '' Declare a String Variable
Dim sql As String '' sql String
strData = Me.Destinations
sql = "Insert into LUtblDestinations (Column1,FKID) Values (""" & strData & """);"
DoCmd.SetWarnings False
DoCmd.RunSQL sql
DoCmd.SetWarnings True
End Sub
However, the Me.Destinations causes Compile error: Method or data member not found. How do I refer to the data I want to use to update the other table?