I have a form where I need to populate an unbound box with values from a table, based on an entry in a textbox on that form. As well the entry in the textbox populates a different table:
Tables: tblDataInput & tblCont
My form is a data entry form based on tblDataInput. The user will input a container number into a field called InputContNbr, this updates the container number in tblDataInput. Then a field on the form called InputContOwn will populate based on the value held in tblCont where the container number on the form matches the container number in tblCont.
I tried the following Event Procedure to make this happen:
Private Sub InputContOwn_Enter()
Dim strSQL As String
Set dbs = CurrentDb()
strSQL = "SELECT tblCont.ContOwn FROM tblCont WHERE (((tblCont.ContNbr)='[Forms]![frmTran1]![InputContNbr]'));"
Me!InputContOwn = strSQL
End Sub
I received an error message: Can't assign a value to this object The debugger points to this line --->Me!InputContOwn = strSQL
Can anyone help me here. This is foreign territory for me.
Thanks
Cindy
Tables: tblDataInput & tblCont
My form is a data entry form based on tblDataInput. The user will input a container number into a field called InputContNbr, this updates the container number in tblDataInput. Then a field on the form called InputContOwn will populate based on the value held in tblCont where the container number on the form matches the container number in tblCont.
I tried the following Event Procedure to make this happen:
Private Sub InputContOwn_Enter()
Dim strSQL As String
Set dbs = CurrentDb()
strSQL = "SELECT tblCont.ContOwn FROM tblCont WHERE (((tblCont.ContNbr)='[Forms]![frmTran1]![InputContNbr]'));"
Me!InputContOwn = strSQL
End Sub
I received an error message: Can't assign a value to this object The debugger points to this line --->Me!InputContOwn = strSQL
Can anyone help me here. This is foreign territory for me.
Thanks
Cindy