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

open pop up form to specific record or create new record

P: 1
Hello, I am new to Access and this forums,

I have two tables and two forms to display the data.

Tables
Tbuilding
Tcriteria

Forms
fmbuilding
fmcriteria

Tbuilding stores basic building data, while Tcriteria stores specific data for some, but NOT ALL, buildings. The two tables are linked through the building ID number(TrusteeID), which is the key in Tbuilding

I would like to create a command button in fmbuilding that opens fmcriteria as a “pop-up” form (not subform, I know it would be easier but need “pop-up” for other reasons, not programming related). I need the “pop-up” form to open to the specific record of the building currently displayed in fmbuilding. I have been able to do this so far with DoCmd.OpenForm and stLinkCriteria, however, if a building does not have a record in fmcriteria, I would need to create a new record in tcriteria and I have been having trouble getting there.

In other words, could I have the command button in fmbuilding open fmcriteria to the current record and if record does not exist go to a blank record using the new TrusteeID so the user can enter the data?

I have not used VBA very much so I am new to this level of design. Please, any help would be greatly appreciated.

I am using Access 2003

Thanks
Aug 29 '08 #1
Share this Question
Share on Google+
1 Reply


NeoPa
Expert Mod 15k+
P: 31,485
I think the concept here is fairly straightforward. From your question you seem to understand the concepts well enough, so I'll pitch my answer for what I think you can grasp. If anything's confusing though, or you need more direction to either understand or implement this then just say so.

What you need, should be simply to open [fmCriteria] from the CommandButton passing a filter in the DoCmd.OpenForm call.

The form will open with the correct record displayed if one exists, otherwise it will open on the New Record slot.

If it's important to set any values in this record so that it matches what you need then that also can be managed, but you don't say what, if any, fields this might apply to.
Aug 29 '08 #2

Post your reply

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