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

Saving rows on a form before opening another form

Status
Not open for further replies.

davidrsutton

Programmer
Oct 6, 2004
94
GB
Hi...

I have a form - frmIssues - which is based on a table - tblissues. TblIssues is quite a large table with a lot of fields, so frmIssues allows the 4 most important fields to be entered in a row on continuous forms.

After inputting those 4 crucial fields, the idea is for the user to then click a button at the end of the row to open up a filtered data entry form - frmsubIssues - where they enter the rest of the info for that issue.

The problem I have is that after I enter the initial info on frmissues, then click on the button, it displays a completely blank frmsubissues form (whereas it should display frmsubissues with those 4 fields filled in that were populated on frmissues, with the rest blank, ready to populate). The way I have to get around this is to click out of the row into the row below and then back into it, then click the button to view a correct subfrmissues - which I'm sure you can appreciate is a right pain in the *$@!. I have tried assigning a macro that saves the table/form to the afterupdate property of the last field you fill in on frmIssues but that didn't work.

I hope all the above makes some kind of sense!? If anyone has got any ideas I would be most grateful

Many thanks in advance,

Dave
 
DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70

Nice language by the way :-D

Herman
Say no to macros
 
Cheers Herman...

So where do I stick that line of code? On the afterupdate of the last field I fill in on frmIssues?

Thanks again,

Dave
 
In the Click event procedure of the button, before the DoCmd.OpenForm call:
DoCmd.RunCommand acCmdSaveRecord

(Note: stay away from the old deprecated doMenuItem method ...)

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
PHV

I've just tried Hermans code and it seems to work a treat.

Dave
 
Keep my note in mind: the DoMenuItem method is discouraged since ac97 !
 
And .... PHV .... I think that you are absolutely correct, it was one of those "If it works dont fix it" things ;-)

Herman
Say no to macros
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top