If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > PC based Database Applications > Microsoft Excel > Open form to specific record, create new record if it does not exist

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 07-22-09, 15:20
LarryL LarryL is offline
Registered User
 
Join Date: Jul 2009
Posts: 7
Open form to specific record, create new record if it does not exist

Greetings!

I have a form which contains a subform. The subform contains records for each upcoming year and brief details about jobs in those years. Each record has a button that I wish to link to a Detailed Description (frmDetailedJobDesciption) form. I'd like to have the button open the form to the corresponding job (based on a jobID) or, if no details record has yet been created, generate a new record and open the form to that blank record.

I know how to do each of those things seperately, but I'm not sure how to combine them. I'm currently using this top open to a specific record:

Code:
DoCmd.OpenForm frmDetailedJobDescription, , , "[jobID]=" & Me![jobID]
And this to open to a new record:

Code:
DoCmd.OpenForm frmDetailedJobDescription, , , acFormAdd
Any help is most appreciated
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On