is it possible to create a form that runs only once when db first run for name etc. And then once saved cannot be changed by end user.
The last bit I can do its just the making it run once as a popup.
Dan
is it possible to create a form that runs only once when db first run for name etc. And then once saved cannot be changed by end user.
Hi Dan,
use DCount function to determine if the underlying table/query of the popup form has records. If DCount = 0, then open the form.
Best,
Jiri
It sounds simple.
I tried alsorts. if statements etc
no matter what I do it moans about the expression.
Basically. The main form opens as an exec. I thought it could have a macro set to onload to do an if record count of tblowner = 0 then open form frmrunonce
I tried stuff like this
DCount([Tbl-Owner]![ID]=0
If DCount("*","Tbl-Owner") = 0 Then
' open the once-only form
End If
It sounds simple.
I tried alsorts. if statements etc
no matter what I do it moans about the expression.
Basically. The main form opens as an exec. I thought it could have a macro set to onload to do an if record count of tblowner = 0 then open form frmrunonce
I tried stuff like this
DCount([Tbl-Owner]![ID]=0
Ok. I now have the form I want to open.
But the run once form opens behind the main form.
Is there a way to force the run once screen to be active?
Set the property "Pop Up" (on the "Other" tab) of the tblowner to Yes.
Best,
Jiri
I have done that.
The main navigation form also has popup and that seesm to take presidence.
I like the main form to float in middle of window rather than fill whole screen, hence why popup is on main form.
Ok, in that case make the run-once form "modal". Set both the property and the open parameter i.e. DoCmd.OpenForm "xxxxx", , , , , acDialog. That should do the trick.
Best,
Jiri
I've added this. still open as I want then the switch round.
They don't seem to like been both popups..
I thought there used to be another way to make a form appear as a poup form or dialogue rather than full screen. Been years since I used last cant remember what it was.
DoCmd.OpenForm "xxxxx", , , , , acDialog
DoCmd.Close acForm, "xxxxx", acSaveNo
Strange. What version of Access are you using ? I have not had issues with popups (on popups) with A2010. Try closing the run-once form explicitly from the main program, like:
Code:DoCmd.OpenForm "xxxxx", , , , , acDialog DoCmd.Close acForm, "xxxxx", acSaveNo
I use this 'second' Close in A2007 and it does have the effect of stopping the execution of the calling program until the called program closes the form from its own module. If you have this code in the OnLoad event, the main module execution should stop before the form display turns on. Good luck.
Best,
Jiri
I'm using access 2010.
the runonce form doesn't need to auto close. The save button on the form does that.
The onload code is on the main form which loads when access opens.
I guess i could put a onload code on the runonce form to close the main form. Then have the the save button also open backup the main form once run once form is completed.
IS that what you mean in you reply?