Connecting Tech Pros Worldwide Help | Site Map

Using a variable for find record method.

Member
 
Join Date: Jan 2007
Posts: 49
#1: Jan 18 '07
Ok what I have is a list of boxes on a form that are connected to fields in my database. There is an extra box I want to be able to put the record number in and it automatically load the data corresponding to that record in the associated boxes. When I have the form running I can go to the editmenu in access and use find(ctrl+f) type in the number and it works. I know it has something to do with the DoCmd.FindRecord method. I tried using DoCmd.FindRecord cboBox,,True,,True and that doesnt work. I need some serious help on this, Thanks in advanced.
Member
 
Join Date: Jan 2007
Posts: 49
#2: Jan 18 '07

re: Using a variable for find record method.


Actually maybe this will make it easier but I still cant figure out how to do it. I have a form that has a subform of a query(named query_1). On that form is a search button with filters. What I want the program to do is after the search is done, you can highlight one of the records then click my add/change delete button, which brings up a form with the corresponding txt boxes, and it brings up the information of the highlighted record in those text boxes.
Expert
 
Join Date: Nov 2006
Location: Andover, Hants, UK
Posts: 215
#3: Jan 18 '07

re: Using a variable for find record method.


Hi

Try using:-
Expand|Select|Wrap|Line Numbers
  1. DoCmd.OpenForm FormName, ,, WhereCondition,acFormEdit 
'WhereCondition' would say something like:-
Expand|Select|Wrap|Line Numbers
  1. "RecordID = " & Me.RecordID
where the recordID comes from a combobox, or whatever..

HTH

Steve
Reply