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 John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

GoToRecord: How to jump to record based on control

Status
Not open for further replies.

tvsmvp

Technical User
Aug 17, 2006
59
US
I'm trying to use a dropdown/combo box control to move all fields (on my current form "WhereWhen") to a particular record.
"Events" is the table
"EventID" is the field
"WhereWhen" is the form
"WhereWhenEventCombo" is the name of the combo

My best attempt so far:
DoCmd.GoToRecord , acGoTo, "[Events].[EventID] = " & Forms!WhereWhen!WhereWhenEventCombo

Gets me the following error message: "Type mismatch." Note that the combo is sent to create a number corresponding to the "EventID."

Is this possible to fix?
 
What is the data type of your Event ID field (in your table)?
 
You may want to try using Forms!WhereWhen!WhereWhenEventCombo.Value
 
The data type of my Event ID field (in the table)is set to AutoNumber.
Re: your next message: I tried adding ".value" - and get the same result: "Type Mismatch."
 
How are ya tvsmvp . . .

Hsve you tried the [blue]combobox wizard[/blue] selecting the 3rd option:
[blue]Find a record on my form based on the value I selected in my combobox?[/blue]

Calvin.gif
See Ya! . . . . . .
 
Apparently the third option (as you describe) doesn't show up when you're working with a form that's pulling from a query (at least in this case, when the query is pulling from two tables) - but of course it does show up when I work on a form simply attached to one table. Do you think maybe that button is supposed to be visible, even with a query but perhaps isn't because of an underlying relationship?
 
tvsmvp . . .

After a 2nd look at your post origination I'm not so sure you just wanna set focus to another record.
tvsmvp said:
[blue]I'm trying to use a dropdown/combo box control to [purple]move all fields[/purple] (on my current form "WhereWhen") to a particular record.[/blue]
[blue]Be more specific about this . . .[/blue]

Calvin.gif
See Ya! . . . . . .
 
Sorry - that did get a tad confusing...

I meant that I want to jump to a particular record. I would change the value in the dropdown - but it was the only control that was showing anothe record. Would "setting focus to another record" cause the controls to reflect the selected record? If so, that'd be perfect.

One thing I did find experimenting since my last post was that establishing a relationship between the two tables made the "third option of the Combo Box Wizard" show up - so that cured the original problem; the records/controls are correctly updating now. But, for future reference, how would I programmatically move to a particular record?
 
tvsmvp said:
[blue]Would "setting focus to another record" cause the controls to reflect the selected record? If so, that'd be perfect.[/blue]
This is the whole Idea of [blue]LookUp on a form[/blue].

Post the [blue]RowSource[/blue] of the combo and state which field you want to [blue]synchronize[/blue] on! . . .

Calvin.gif
See Ya! . . . . . .
 
Sounds like what I need - I'll check it out. Thanks much for the help.
 
The row source should be the field "EventName" from the "Events" table; the resulting record set should be synched to the "EventID" as selected by the control "WhereWhenEventCombo.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top