Combo After Update To populate text box

  • Thread starter Thread starter Richard Messer via AccessMonster.com
  • Start date Start date
R

Richard Messer via AccessMonster.com

I have a combo box that when after update, I'd like to auto populate the
text box named "ReportArea".

The following is my code but it's not working:

Private Sub Rptdby_Click()
Me.RptDate = Date
Me.RptTime = Time()

Me.ReportArea = Me.ReportArea.ColumnHidden(1)

End Sub

Thanks,
Richard
 
Richard,

There are some issues to clean up here.

Me.ReportArea = Me.ReportArea.ColumnHidden(1)
You state that ReportArea is a text box. Text boxes have no ColumnHidden
property. I assume you are trying to assign a value from a hidden column in
your combo box.

Private Sub Rptdby_Click()
You state you want to do this in the After Update, so why is the code in
this Sub? Is this the Click Event for the combo box?

I will assume your combo box ins named Rptdby and I think what you are
trying to do is this:

Private Sub Rptdby_AfterUpdate()
Me.RptDate = Date
Me.RptTime = Time()

Me.ReportArea = Me.Rptdby.Column(1)
'This assumes column 1 of your combo box is the value you want for the row
selected. Be aware that Column(0) is the first column.

End Sub
 
Back
Top