Allow Form 'on load' to finish before continue

SarahHall

Registered User.
Local time
Today, 22:27
Joined
Jan 15, 2011
Messages
32
Hi there,

I'm currently writing a procedure which opens a form and then performs certain changes to it, based on that procedure's arguments.

I want this procedure to wait for the form's 'load' process to complete before it continues. Is there any way I can easily indicate this?

Thanks
 
Sure - I'll do my best!

I have a set of four data entry forms, which users will use to complete 1 record over several sessions. Each combo drops a numerical value into a field-bound invisible text box, so when they re-open the record, I have SQL to put the 'user friendly' text values back into the combos. This is during the 'on load' event.

I have a seperate procedure which opens for viewing the data only and not for data entry. By the docmd.openform method, it opens the same form but then locks all the text/combo controls so the user can 'look but not touch'. The problem is, it locks the controls before they can be updated with the text values.

I hope this makes sense.
 
Each combo drops a numerical value into a field-bound invisible text box, so when they re-open the record, I have SQL to put the 'user friendly' text values back into the combos. This is during the 'on load' event.
Could you do this instead:
Bind the combo to the field by a hidden column that has the numerical value and scrap the tex box
 
Could you do this instead:
Bind the combo to the field by a hidden column that has the numerical value and scrap the tex box

Thanks - that makes sense. How would I do this? Normally I would bind a control by using the control source property, but this obviously wouldn't work for the hidden column...
 
Ok. Sorry, I didn't make myself clear - I would normally set it using the control source property in the properties box, but I'm not sure I can use that method for a specific column of a control. The only other way I can think of doing this is programmatically. If you are suggesting I do this via VBA, at which event would you suggest doing it?
 
Hi Sarah
I would normally set it using the control source property in the properties box
Correct. Do that.
I'm not sure I can use that method for a specific column of a control
Set the "Bound Column" property to the column that holds the number.
You will also need to set the "Coulmn Count" property (to 2 I'm gussing) and set the "Column Widths" property (Somthing like 0cm;2cm) where 0 is the hidden column.
 
Of course! Silly me. Thank you very much for your help!
 
out of interest, the way you dedcribe your problem ....

locking a textbox would not prevent you "pushing" a value into it in code - it just prevents user interaction.

one way you could achieve this stuff is to code it in the forms current event (if necessary with a one-time use boolean flag)
 
Hi there,
I want this procedure to wait for the form's 'load' process to complete before it continues.

Does OnOpen not run before the form "Loads"?

Consider the order events falls in when opening/closing form:

OnOpen -> OnLoad -> Activate (I think) -> OnCurrent -> DeActivate -> OnUnLoad -> OnClose

Now, because of the ordering, you can cancel a OnOpen load, but not Load (as it's already open), and you can cancel a UnLoad (because it's not removed from screen just yet) but not the OnClose.

Open and Close events has to do with "loading" the forms into the memory but they are not quite on the screen.

Load/Unload event is when forms actually shows on the screen.

Activate/Deactive is when forms has focus or lost focus.

http://www.access-programmers.co.uk/forums/archive/index.php/t-113078.html
 

Users who are viewing this thread

Back
Top Bottom