access 2010 suspend VBA code until a table has been closed

I have created a form which needs information from a table but the table needs to be updated and closed before the VBA code within the form can continue.

I believe that the form code needs to include something like:

MsgBox "Populate the 'Reqd' field in this table with Yes or No and save the table before continuing." 
DoCmd.OpenTable "tblCloneTheseFields", , acEdit

Can you offer some suggestions please?

Regards
Barry GC
 

You can't do that with a table.


Instead of opening a table, open a form based on the table using DoCmd.OpenForm, and specify WindowMode:=acDialog:


DoCmd.OpenForm FormName:="frmCloneTheseFields", WindowMode:=acDialog


The code will pause until the user closes the form.

---
Kind regards, HansV
https://www.eileenslounge.com

1 person was helped by this reply

·

Did this solve your problem?

Sorry this didn't help.

Great! Thanks for marking this as the answer.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this response?

Thanks for your feedback.

You win my admiration again .Thanks for that.

Regards
Barry GC 

Did this solve your problem?

Sorry this didn't help.

Great! Thanks for marking this as the answer.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this response?

Thanks for your feedback.

I got it working but it only shows one record at a time. Can I get "frmCloneTheseFields" to open in datasheet mode?


Regards

BarryGC 

Did this solve your problem?

Sorry this didn't help.

Great! Thanks for marking this as the answer.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this response?

Thanks for your feedback.

Yes, you can specify the view:


DoCmd.OpenForm FormName:="frmCloneTheseFields", WindowMode:=acDialog, View:=acFormDS

---
Kind regards, HansV
https://www.eileenslounge.com

Did this solve your problem?

Sorry this didn't help.

Great! Thanks for marking this as the answer.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this response?

Thanks for your feedback.

Actually, datasheet forms do NOT open in dialog. You have to use a continues form that "looks" like a data sheet. If you "must" use a datasheet, then you have to drop it into a form as a sub form and launch that main form with the DS as a sub form.


If you don't want to have to use two forms (form + sub form datasheet), then you can use one continues form that looks much like a data sheet.


So DS cannot be opened as dialog forms.


Best regards,

Albert D. Kallal (Access MVP)
Edmonton, Alberta Canada

Did this solve your problem?

Sorry this didn't help.

Great! Thanks for marking this as the answer.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this response?

Thanks for your feedback.

Good point, thanks!
---
Kind regards, HansV
https://www.eileenslounge.com

Did this solve your problem?

Sorry this didn't help.

Great! Thanks for marking this as the answer.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this response?

Thanks for your feedback.

I have not been able to fully understand the intricacies in setting up the continuous form or the form plus sub-form datasheet. This is perhaps because the form has no bound fields and is used to collect parameters for the work flow.

My workaround simply requires the 'datasheet layout' table to be opened, modified and closed. The user then enters the form to collect the parameters ets. Whilst this is not optimal, it is sufficient for my current needs. I will put the original issue on the back burner and may have a go further down the track.

Thanks for your valued assistance guys.

Regards,
Barry GC 

Did this solve your problem?

Sorry this didn't help.

Great! Thanks for marking this as the answer.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this response?

Thanks for your feedback.

 
 

Question Info


Last updated February 12, 2018 Views 745 Applies to: