EDIT: I don't know how that thumbs down icon got inserted into my post. I think I hit the tab key on my keyboard by accident and I can't seem to be able to remove it. /EDIT
I don't understand what you are doing with the control source of your Option158 control. The control source is what binds a control to a field/column in a table. Perhaps you want to test the value of the control.
Code:
if me.Option158.value = -1 then
msgbox "Value is true"
elseif me.Option158.Value.value = 0 then
msgbox "Value is false"
else
msgbox "Value is Null"
end if
That aside, you can declare variables and then assign values to your variables. Then you can use your variables in an SQL statement. So something like.
Code:
dim lngTableOneID as long
dim strSQL as string
if not isnull(Me.TableOneID.Value) Then
lngTableOneID = Me.TableOneID.Value
end if
strSQL = "INSERT INTO TblLocation (TableOneID) VALUES (" & lngTableOneID & ")"
currentdb.execute strSQL