In Access 2000!
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 Dao.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. Do I need to set an index? how to make index container field?
Can anyone help? Thanks! "The greatest risk, is not taking one."
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 Dao.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. Do I need to set an index? how to make index container field?
Can anyone help? Thanks! "The greatest risk, is not taking one."