Form Operations Misc (1 Viewer)

Weekleyba

Registered User.
Local time
Today, 00:19
Joined
Oct 10, 2013
Messages
586
I'm stumped on trying to get a couple things to work in my database.
Perhaps someone could help me out.

1. I can have multiple contracts in a single project and so that's how this database will be set up. You can open the contract with the use of a command button "Open". However, I want to prevent the user from opening the F_Contract when the cboContract is blank.
I've tried I number of things but just can't get it to work.
Any ideas here?

2. I use the Edit List Form to add new contract numbers to the combo box. I'd like to have the contract number that the user just created in the edit list form, to be inputed automatically, into the cboContract once they close the edit list form.
Any ideas?

Attached is a sample database to show the issue.
Thanks for any help!
 

Attachments

  • Combo Command Test.accdb
    528 KB · Views: 71

theDBguy

I’m here to help
Staff member
Local time
Yesterday, 22:19
Joined
Oct 29, 2018
Messages
21,449
Hi. I'm not in front of a computer right now but for question #1, check if the combobox is not empty before opening your form. And for #2, you can set the Default Value property of your edit form to refer to the combobox.
 

June7

AWF VIP
Local time
Yesterday, 21:19
Joined
Mar 9, 2014
Messages
5,463
A project can have multiple contracts but each contract can associate with only one project? If so then don't need junction table T_ProjCont. Save ProjectID in T_ContractNumber.
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 13:19
Joined
May 7, 2009
Messages
19,228
here you may test.
 

Attachments

  • Combo Command Test.accdb
    576 KB · Views: 69

Weekleyba

Registered User.
Local time
Today, 00:19
Joined
Oct 10, 2013
Messages
586
Arnelgp, thank you very much for the help!
I did not know about the ListIndex property. That makes it easy.
Also, I hadn't used the NotInList property either. Another great tool.

One question on that. The unbound textbox TextSaved, is that only there so you can use the Response = acDataErrAddeda and Response = acDataErrContinue and a textbox for the form F_Project to allowed to be saved?

Thanks again for you help on this. Got me off of high center, and helps me learn more VBA.
 

Users who are viewing this thread

Top Bottom