0
votes

I'm new to forms in MS access and I've created a form with a combo box that auto fills a few things i'm looking for, basically and name, phone #, and check out date. I have added another text box for "check in date" and I'm able to input the date but it will update the first record in the table that I'm pulling information from and not the record that the auto fill combo box displays. would anyone know a fix to update the record that the auto fill display versus the top record of the table?

Private Sub Combo0_Change()

Me.txtfname = Me.Combo0.Column(1)
Me.txtlname = Me.Combo0.Column(2)
Me.txtphone = Me.Combo0.Column(3)
Me.txtpump = Me.Combo0.Column(4)
Me.txtdateissue = Me.Combo0.Column(5)
Me.txtduedate = Me.Combo0.Column(6)
Me.txtCheckInDate = Me.Combo0.Column(7)

End Sub




Private Sub Combo0_Click()

End Sub

Private Sub txtCheckInDate_Change()

End Sub

enter image description here

1
Please edit your question so as to include a Minimal, Complete, and Verifiable example.MJH
Your combo box is just filling in the record you currently have open (i.e. the first record.) That's why only the top record is updating. You need to first have you trigger go to the record you want to update (research docmd.findrecord) and then update your current record. I'm assuming your form is bound to the table you are updating? Other option is to change the recordsource of your formgeeFlo
yep, it's bound to the tablePmanivong

1 Answers

0
votes

get the source of Combo0 combobox, then in Private Sub txtCheckInDate_Change() function, change its source to that source + your filter, like

 Me.Combo0.RowSource = "[Existing Combo Source SQL]" & _
 " WHERE [YourDateField] = #" & me.txtCheckInDate & "#"