Hi everyone,
I have a form with a combo box, whose afterupdate code is:
Private Sub CustomerName_AfterUpdate()
Dim rs As Recordset
Dim person As String
{This will contain the SQL Statement}
person = "select people.department from people where people.name='" &
CustomerName.Value & "'"
Set rs = CurrentDb.OpenRecordset(person)
{Now the following are combo/text boxes that are populated}
Department.Value = rs("department")
InputDate = Date
InputTime = Time
My code works: when you select something in CustomerName combo box, the other
boxes in the record get populated with data. The problem is that ALL the records in the
form get populated with this data as well...
I want the records to be independent of each other - that each record will be filled
separately.
Any ideas?
Thanks,
Gilad.
I have a form with a combo box, whose afterupdate code is:
Private Sub CustomerName_AfterUpdate()
Dim rs As Recordset
Dim person As String
{This will contain the SQL Statement}
person = "select people.department from people where people.name='" &
CustomerName.Value & "'"
Set rs = CurrentDb.OpenRecordset(person)
{Now the following are combo/text boxes that are populated}
Department.Value = rs("department")
InputDate = Date
InputTime = Time
My code works: when you select something in CustomerName combo box, the other
boxes in the record get populated with data. The problem is that ALL the records in the
form get populated with this data as well...
I want the records to be independent of each other - that each record will be filled
separately.
Any ideas?
Thanks,
Gilad.