Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

GoToRecord with ComboBox choice

Status
Not open for further replies.

VBAnewguy

MIS
Jan 28, 2003
41
0
0
US
After spending the past hour searching, I must finally ask for help!!

I am building a simple data entry form for my users to enter and maintain some information. I would like for them to be able to pick records from a list using a combobox and have the form navigate to the complete record.

I know I need to use the DoCmd.GoToRecord,, function, but I am getting lost in the sytax.

Here is some info:

FormName = EventEntry_Form
ComboBoxName = EventCombo
combo contains field = EventName

if anyone could help me build the syntax I would greatly appreciate it.

Thanks in advance,

 
If you use the combobox wizard to add the combo to your form it will give you the option of finding a record in the form.
(You cannot use the same combo box for entering a value into the table).
 
Thanks, I tried that, it does not seem to work, I guess it has something to do with the fact the the combobox values come from the same table that the Form's records do...
 
Something Like this ?
Code:
Private Sub cboCaller_AfterUpdate()	
	Me.txtCallerName.Value = Me.cboCaller.Column(2)
	Me.txtEmail.Value = Me.cboCaller.Column(3)
End Sub


Zameer Abdulla
[sub]Jack of Visual Basic Programming, Master in Dining & Sleeping[/sub]
Visit Me
 
With the combo wizard create an unbound combo for finding a record in the current form (3rd option of the wizard I guess).

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
I have tried using the third radio button, here is what i get:

Data cannot be retrieved from the source you have selected. You must select a different table or query to continuein the wizard.
 
Of course they do! How are you going to choose a record from the list otherwise.
But what you were attempting in your code in your Q is the code the wizard generates for you.
There are only 4 steps to this wizard,and only one step where you actually make any choices (choosing which fields to see in the drop-down list). It's difficult to imagine where it can go wrong.
 
um, ok... so, am I wrong in assuming that I can use the DoCmd.GoToRecord,, function to do this?
 
What is the recordsource of your form?
If it is a query please get the SQL view and post that here.
 
This is what I was looking for, found it on another forum, in case anyone needs it:



DoCmd.ShowAllRecords
Me.MATCHFIELD.SetFocus
DoCmd.FindRecord Me.COMBOBOX
Me.COMBOBOX.Value =
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top