Assigning values from 1 combo box to 2 textboxes.

  • Thread starter sike11 via AccessMonster.com
  • Start date
S

sike11 via AccessMonster.com

Hello,

I am not sure if this is possible.

I have 2 textboxes which the user has been instructed to use for a search. I
also have a combo box. The following is the properties section of the combo
box.

SELECT [qryQOE-ManualUpdate].student_studentreference, [qryQOE-ManualUpdate].
[student-surname], [qryQOE-ManualUpdate].student_forenames, Trim(
[student_forenames]) & " " & Trim([student-surname]) AS Student FROM [qryQOE-
ManualUpdate] ORDER BY [qryQOE-ManualUpdate].[student-surname];

I have put this in the AfterUpdate event of the combo box.

Private Sub Student_AfterUpdate()

Me.Student.Column(1) = Me.txtSurname
Me.Student.Column(2) = Me.txtForenames

Me.Student.Requery
End Sub

Every time I run the form, I get a runtime message saying "Run-time error
'424' - Object required".

I am not sure if this does not work becauseit is the same 2 text boxes used
in the search that has to be filled.

Can anyone please advise/help?
 
D

Douglas J Steele

You've got your assignment statements backwards:

Me.txtSurname = Me.Student.Column(1)
Me.txtForenames = Me.Student.Column(2)
 
S

sike11 via AccessMonster.com

Thank you. Worked like a charm!! Could you help me further? Once I chose a
name from the combo box, is there any way for me to be able to chase another
name using the same criteria?

Regards,

Mary.
You've got your assignment statements backwards:

Me.txtSurname = Me.Student.Column(1)
Me.txtForenames = Me.Student.Column(2)
[quoted text clipped - 26 lines]
Can anyone please advise/help?
 
D

Douglas J Steele

Sorry: I don't understand your question.

Can you elaborate?

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


sike11 via AccessMonster.com said:
Thank you. Worked like a charm!! Could you help me further? Once I chose a
name from the combo box, is there any way for me to be able to chase another
name using the same criteria?

Regards,

Mary.
You've got your assignment statements backwards:

Me.txtSurname = Me.Student.Column(1)
Me.txtForenames = Me.Student.Column(2)
[quoted text clipped - 26 lines]
Can anyone please advise/help?
 
S

sike11 via AccessMonster.com

Sorry,

What I mean is, when I went back to the combo box to choose another name in
the list, it did not allow me to do so. Is there any way for me to do that
using the same criteria I initially inserted in the text box?

Thanks in advance.
Sorry: I don't understand your question.

Can you elaborate?
Thank you. Worked like a charm!! Could you help me further? Once I chose a
name from the combo box, is there any way for me to be able to chase another
[quoted text clipped - 14 lines]
 
D

Douglas J Steele

You mean you want to be able to choose more than one name? Combo boxes are
simply single-select. To get multi-select capabilities, you need to use a
list box.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


sike11 via AccessMonster.com said:
Sorry,

What I mean is, when I went back to the combo box to choose another name in
the list, it did not allow me to do so. Is there any way for me to do that
using the same criteria I initially inserted in the text box?

Thanks in advance.
Sorry: I don't understand your question.

Can you elaborate?
Thank you. Worked like a charm!! Could you help me further? Once I chose a
name from the combo box, is there any way for me to be able to chase
another
[quoted text clipped - 14 lines]
Can anyone please advise/help?
 
S

sike11 via AccessMonster.com

Thank you.

Is there any way to get the form to refresh so that I can input another
search criteria?

I tried "Me.requerry" but it does not seem to refresh the form and leaves the
value of the old result in the combo box. Any advise greatly appreciated.

Rgerads,
You mean you want to be able to choose more than one name? Combo boxes are
simply single-select. To get multi-select capabilities, you need to use a
list box.
[quoted text clipped - 13 lines]
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top