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

Going to the New Record on Form

Status
Not open for further replies.

cneill

Instructor
Mar 18, 2003
210
GB
Hi

I current have this piece of code on a pop up form as part of the save new Scheme action.

Dim HldSID As String
HldSID = Me.SchemeID
Forms![FrmSchemes].Recordset.FindFirst "[SchemeID] = " & HldSID
DoCmd.Close acForm, Me.Name

This code finds the new record on the FrmSchemes so works fine.
I now what to add some changes to it so that the HldSID = two pieces of information. I have tried this

Dim HldSID As String
HldSID = Me.SchemeID And Me.PhaseID
Forms![FrmSchemes].Recordset.FindFirst "[SchemeID]And[PhaseID]= " & HldSID
DoCmd.Close acForm, Me.Name

But I can't get it to work, any thoughts please
Thanks
CNEILL
 
Something like:
Code:
HldSID = Me.SchemeID & Me.PhaseID
Forms![FrmSchemes].Recordset.FindFirst "[SchemeID]& [PhaseID]= " & HldSID
DoCmd.Close acForm, Me.Name
Hope this helps

HarleyQuinn
---------------------------------
The most overlooked advantage to owning a computer is that if they foul up there's no law against wacking them around a little. - Joe Martin

Get the most out of Tek-Tips, read FAQ222-2244 before posting.

 
Hi HarleyQuinn

Your a star, all fixed many thanks

CNEILL
 
Glad I could help [smile]

HarleyQuinn
---------------------------------
The most overlooked advantage to owning a computer is that if they foul up there's no law against wacking them around a little. - Joe Martin

Get the most out of Tek-Tips, read FAQ222-2244 before posting.

 
A more conventional way:
Code:
Forms![FrmSchemes].Recordset.FindFirst "SchemeID=" & Me!SchemeID & " AND PhaseID=" & Me!PhaseID

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top