Click to See Complete Forum and Search --> : Bound form -- Move to record with matched criteria
kfcSmitty
Aug 8th, 2005, 10:01 AM
I have a somewhat bound form (ID, Name, Anniversary, etc are bound), but lots of other stuff isnt. Now, what I need to do, is when the user changes the ID combobox (populated with all the ID's from a table), it will move to the record with the proper ID.
If the form wasnt bound this would be simple, however, since it is, I cant find any way to accomplish this.
Would the only way be to use DoCmd,,AcNext/Previous until it hits the correct record?
dannymking
Aug 8th, 2005, 10:09 AM
No just requery the recordsource in the afterupdate event on the combobox..
Me.RecordSource = "SELECT * FROM tblTable WHERE condition"
kfcSmitty
Aug 8th, 2005, 10:24 AM
much obliged..Thats 2 reps I owe ya ;)
dannymking
Aug 8th, 2005, 10:26 AM
Don't worry about it... it's not always about reps.. besides I get a lot anyway (albiet most of them are grey.. :D)
kfcSmitty
Aug 8th, 2005, 02:19 PM
I just realised..this doesnt move to the selected record, it requeries so its the only record being displayed..thats no good :(
dannymking
Aug 8th, 2005, 03:13 PM
Yeah it will reduce it down to just the record that is created..
The command you need is
you will need to work out the position of the record
DoCmd.GoToRecord , ,acGoTo=12
Either that or you will need to program up a return button to cancel the filter..
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.