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

Go to Record after requery

Status
Not open for further replies.

pomster

Technical User
Jan 15, 2003
88
0
0
AU
I have a form with a number of tabs on it. The second tab contains 3 pictures with associated add/delete buttons. When I add or delete a picture the form is requeried to update the picture. It also goes back to record 1 rather than staying on the current record. I have read a number of posts and decided that this snippet should work.


Forms![Members].Form.Requery
Me.Recordset.FindFirst "MemberID = " & RecordNo

(RecordNo is a variable containing the current record number)

However, as you probably realise it doesn't. Does anyone have an idea of what to do? This is the last outstanding issue with this project so I am pretty keen to get it resolved.

cheers,


David




 
How are ya pomster . . .

Hold the [blue]primarykey[/blue] first, then requery (the following assumes primarykey is numeric):
Code:
[blue]   Dim hldID As Long
   
   hldID = Me![purple][b][i]PKname[/i][/b][/purple]
   Me.Requery
   Me.Recordset.FindFirst "[[purple][b][i]PKname[/i][/b][/purple]] = " & hldID[/blue]

Calvin.gif
See Ya! . . . . . .

Be sure to see FAQ219-2884:
 
Thanks AceMan, worked like a charm!!
 
Hi AceMan
I came across this which seemed to answer a similar sort of problem that I have that when users requery a field that is not the first form, it jumps back to the first form. When I enter the code, however, I get the message 'Syntax error (missing operator) in expression. I copied the code straight from the worksheet and pasted it into the sub, only replacing 'PKname' with the name of the Primary Key in the table. Any other suggestions?

terkle
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top