By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,064 Members | 1,445 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,064 IT Pros & Developers. It's quick & easy.

holding the same field between forms

P: 1
I have a access database where i have a number of different forms and tables but all with a unique identifer of ClientNo. when i move between forms i want the form i open to open in the same ClientNo as the form i was previously in. They are separate forms and separate tables. If the client no does not exist in the 2nd form then i need a message or something to promt the user to enter a new record!!!!!!!!!

Any suggestions!!!!!!
Aug 12 '08 #1
Share this Question
Share on Google+
2 Replies


100+
P: 167
Hi ffm,

You can do the same our brain does :-)
[HTML]Open Form1. On close remember the Client no. (on close event in Form1 store the Client no. from a current record into the Public variable
Open Form2
Find a Client no. you remembered (DoCmd.FindFirst.... look through the Client no. field in Form2 for a value stored in a variable)[/HTML]

Note: if there is no value you were looking for it will automaticaly give you the prompt!
Aug 12 '08 #2

NeoPa
Expert Mod 15k+
P: 31,494
There are two ways that spring to mind to select records of a form you are about to open in code.
  1. Prepare a filter string then open the form with that string as the WhereClause parameter.
  2. Pass the value of the ID across into the form on open with the OpenArgs parameter.
Be a little careful of the OpenArgs parameter when trying to access it from within the newly opened form though. If it's not saved as one of the first commands in the code, it will disappear.
Aug 12 '08 #3

Post your reply

Sign in to post your reply or Sign up for a free account.