I have a Form that is bound to a Query.
With the Form Open in an Unbound text box. Type in a number. Then click a comand button will go to correct record in the table?
How do you navigate to the correct record?
Any Example would be great..
I have a Form that is bound to a Query.
With the Form Open in an Unbound text box. Type in a number. Then click a comand button will go to correct record in the table?
How do you navigate to the correct record?
Any Example would be great..
Last edited by wes028; 01-14-2010 at 08:34 AM.
what you describe sounds like the vanilla function/intention of a combobox;
when you add it to the form the wizard will step you thru it....
I've tried the combo box method. but i'm trying to keep the data shown tied to Query to display the one record. Then i can update the data needed to be updated in the table.
Unless you know of a way that one can update a record of the table? Still searching for an option to get this done. Would be open to any idea's to get this done.
Thanks
what we have here is a failure to communicate.
to navigate records, in a form (in single mode and not continuous mode) one can of course simply use the embedded record selector at bottom
or one can add a combobox/listbox and select any record that way
one could construct a method to use an unbound text box; user enters record value - the underlying query of the form's record source uses the textbox as criteria - and you force the query to requery & the form to refresh... in this approach the user must know what value to enter as there is no choice offered as in a combo/list box method....
one could construct a method to use an unbound text box; user enters record value - the underlying query of the form's record source uses the textbox as criteria - and you force the query to requery & the form to refresh... in this approach the user must know what value to enter as there is no choice offered as in a combo/list box method....
Yes... You got it. that's what i'm trying to do.. I cant get the criteria down to display the correct record.
here is the Query. The PK is injAutoNumber
Code:SELECT tblInjection.injAutoNumber, tblInjection.EmployeeNumber, tblInjection.ReJobNumber, tblInjection.ReOperationNumber, tblInjection.ReSubCode, tblInjection.ReSerialNumber, tblInjection.StartDateTime, tblInjection.Start, tblInjection.Scrap, tblInjection.Balance, tblInjection.EndDateTime FROM tblInjection;
I've tried using a Dlookup command to get the record. But cant get that to work either.
Code:Me.txtSer = DLookup("[ReSerialNumber]", "qrySerialFind", _ "[ReSerialNumber] = '" & Forms!frmFinishRouter!txtSer & "'")
Wes,
I think you are making this too difficult. A list box or combo box will allow a user to select a record from a drop down and when the record is selected it will display the resutls of that record in your form
Will this work for what you are trying to do?
to use a query criteria that is a value in a form's text box; just make a query using query design
in the criteria of the appropriate field put:
Forms!YourFormName.YourTextBoxName
Thanks NTC.. Let's try one more thing. How would you recall the query to run again. If the form is open. Or to get it to update to a command button.
Would it be something like
Me.ReQuery QueryName?
Or is there something you have to do to refresh the form also?
thanks,
docmd.requery "queryname"
me.refresh
actually try just the me.refresh and the form reopen may trigger the source query to rerun also....can't remember now....
Thanks NTC for your help..
Was able to find another way to get record.. thanks
Code:Dim rs As Object Set rs = Me.Recordset.Clone rs.FindFirst "[ReSerialNumber] = " & Me![txtSer] & "" If Not rs.EOF Then Me.Bookmark = rs.Bookmark