I have a form that has a combo box pulling a container # value from a table field. the table has the fields Vessel, Container, & Cartons. On my form (unbound) I would like when cmbbox_lostfocus to look back in the table and find the the vessel and cartons for that record and populate the appropriate fields on my form. this is what I've tried:
Dim StrContainer As String
Dim Db As Database
Dim Rst As Recordset
Dim StrVessel As String
Set Db = CurrentDb
Set Rst = Db.OpenRecordset("Tbl_Container Schedule"
StrContainer = CmbContainer.Value
Rst.FindFirst StrContainer
StrVessel = Rst.Fields("vessel"
.Value
'MsgBox StrVessel
Rst.Close
TxtVessel.value = strvessel,
But I get an error on the find first.
Can anyone help? THanks! "The greatest risk, is not taking one."
Dim StrContainer As String
Dim Db As Database
Dim Rst As Recordset
Dim StrVessel As String
Set Db = CurrentDb
Set Rst = Db.OpenRecordset("Tbl_Container Schedule"
StrContainer = CmbContainer.Value
Rst.FindFirst StrContainer
StrVessel = Rst.Fields("vessel"
'MsgBox StrVessel
Rst.Close
TxtVessel.value = strvessel,
But I get an error on the find first.
Can anyone help? THanks! "The greatest risk, is not taking one."