Lock Fields on Form and Subform Based On One Field Value (1 Viewer)

billgyrotech

Banned
Local time
Today, 17:56
Joined
Apr 18, 2013
Messages
258
Thank you DBguy,


It does lock the main form and subform however there a few things that I noticed:


1) I cannot add "New" record
2) Since I can't add the new record I cannot add Customers, Part Numbers, or Descriptions. There are Add buttons next to the fields.
3) I also found that I cannot search records by the drop down in the header.


Can you please take a look?


I appreciate any help
 

theDBguy

I’m here to help
Staff member
Local time
Today, 15:56
Joined
Oct 29, 2018
Messages
21,454
Thank you DBguy,

It does lock the main form and subform however there a few things that I noticed:

1) I cannot add "New" record
2) Since I can't add the new record I cannot add Customers, Part Numbers, or Descriptions. There are Add buttons next to the fields.
3) I also found that I cannot search records by the drop down in the header.

Can you please take a look?

I appreciate any help
Hi Bill. Just as a quick fix, try the attached updated copy. You should be able to add new records now. I'll see what I could do with the search drop down.
 

Attachments

  • AFR System 12.1.zip
    1.1 MB · Views: 80

theDBguy

I’m here to help
Staff member
Local time
Today, 15:56
Joined
Oct 29, 2018
Messages
21,454
Thank you DBguy,

3) I also found that I cannot search records by the drop down in the header.


I appreciate any help
Okay, try this one. I'm on my way out of the office right now, so I'll check back in later.
 

Attachments

  • AFR System 12.1.zip
    1.1 MB · Views: 93

billgyrotech

Banned
Local time
Today, 17:56
Joined
Apr 18, 2013
Messages
258
There may be more issues but I tried to go through adding a new record. There will only be some fields filled out by the Clerk and then the Tear Down report gets printed. This will be a traveler that stays with the unit that is need of repair.


So when I tried to close the AFR after this initial data entry process the popup says a related field is required for all the drop downs one at a time. The Dispositions is one in particular that isn't filled out until the repair is closed.


I am not sure how to stop these popups and accept the partial entries.


Do you know why?
 

theDBguy

I’m here to help
Staff member
Local time
Today, 15:56
Joined
Oct 29, 2018
Messages
21,454
There may be more issues but I tried to go through adding a new record. There will only be some fields filled out by the Clerk and then the Tear Down report gets printed. This will be a traveler that stays with the unit that is need of repair.

So when I tried to close the AFR after this initial data entry process the popup says a related field is required for all the drop downs one at a time. The Dispositions is one in particular that isn't filled out until the repair is closed.

I am not sure how to stop these popups and accept the partial entries.

Do you know why?
Hi. I looked at your original file again and it seems this issue is not related to the code I added. Meaning, this problem is a separate issue to the one we were discussing in this thread. I'll have to take a deeper look into the form's design to be able to answer this particular question. I'll do that when I get back from my appointment.
 
Last edited:

billgyrotech

Banned
Local time
Today, 17:56
Joined
Apr 18, 2013
Messages
258
The initial data entries for new records are made in these fields:


AFR Number
SO Number
Clerk
Customer
Description
Part Number
Serial Number
Customer Complaint
Preliminary Inspection
Warranty (default should be unchecked)

Proper ID (default should be checked)

Hidden Damage (default should be unchecked)

Checked ADs (default should be checked)

Checked SBs (default should be unchecked)


The Status field should be "Open" for New Records.


I was able to set the defaults for these fields.


Thanks for any help
 
Last edited:

Gasman

Enthusiastic Amateur
Local time
Today, 23:56
Joined
Sep 21, 2011
Messages
14,238
I am getting compile error (it highlights Status)



Private Sub Form_Current()
Me.AllowEdits = Me.Status <> "Closed"
Me.AFRsParts.Form.AllowsEdits = Me.Status <> "Closed"
End Sub

OK, that would be me. You stated that you wanted to check the Status control.?

However, I see you are in good hands so I will bow out.
 

billgyrotech

Banned
Local time
Today, 17:56
Joined
Apr 18, 2013
Messages
258
I think DBguy addressed that issue but there are more complications. He is checking into it when he has time.


Thank you
 

theDBguy

I’m here to help
Staff member
Local time
Today, 15:56
Joined
Oct 29, 2018
Messages
21,454
The initial data entries for new records are made in these fields:


AFR Number
SO Number
Clerk
Customer
Description
Part Number
Serial Number
Customer Complaint
Preliminary Inspection
Warranty (default should be unchecked)

Proper ID (default should be checked)

Hidden Damage (default should be unchecked)

Checked ADs (default should be checked)

Checked SBs (default should be unchecked)


The Status field should be "Open" for New Records.


I was able to set the defaults for these fields.


Thanks for any help
Okay, I clicked on the New button and filled out the form as follows:
AFR Number = 111
SO Number = 111
Clerk = Xenobia Harvey
Customer = 21 Computer
Description = 21 Computer
Part Number = 13A655
Serial Number = 111
Customer Complaint = TEST
Preliminary Inspection = TEST
Warranty = unchecked
Proper ID = checked
Hidden Damage = unchecked
Checked ADs = checked
Checked SBs = checked
Status = Open


At this point, I am not sure what to do next. I don't see a Save button. How would I see the error message you mentioned earlier?
 

billgyrotech

Banned
Local time
Today, 17:56
Joined
Apr 18, 2013
Messages
258
When I try to close the form I get the message. Oh by the way when previewing or printing reports I put Me.Refresh in the codes. I hope that is proper.
 

theDBguy

I’m here to help
Staff member
Local time
Today, 15:56
Joined
Oct 29, 2018
Messages
21,454
When I try to close the form I get the message. Oh by the way when previewing or printing reports I put Me.Refresh in the codes. I hope that is proper.
Re: Me.Refresh - It depends on what your intention was. Typically, if you want to make sure the data is saved, you would use:
Code:
If Me.Dirty Then Me.Dirty = False
Okay, I clicked on the new button, and entered the data as I posted above. When I tried to close the form, I got an error message about the Disposition dropdown. To fix that, I had to remove all the default values for numeric data from your table (except for Labor Hours). Try the attached now...
 

Attachments

  • AFR System 12.2.zip
    1.1 MB · Views: 93

billgyrotech

Banned
Local time
Today, 17:56
Joined
Apr 18, 2013
Messages
258
Thank you DBguy you have been most helpful. So far it is very good.


On the New AFR the main form looks like it all works fine. However I cannot add parts. I am sorry this has been very complicated. This part can wait if you don't have time I will see what I can do.
 

theDBguy

I’m here to help
Staff member
Local time
Today, 15:56
Joined
Oct 29, 2018
Messages
21,454
Thank you DBguy you have been most helpful. So far it is very good.

On the New AFR the main form looks like it all works fine. However I cannot add parts. I am sorry this has been very complicated. This part can wait if you don't have time I will see what I can do.
Okay, yes, I am getting ready to leave again. I'll let you give it a try and let us know how you get along. Good luck!


PS. Just out of curiosity, I took a quick look at your subform for adding parts. You have its Allow Additions property set to No. See what happens if you set it to Yes. Cheers!
 

billgyrotech

Banned
Local time
Today, 17:56
Joined
Apr 18, 2013
Messages
258
Perfect the allow additions did it. Thanks so much I will close this thread and get back to work on the database Monday.


Cheers to you too!
 

theDBguy

I’m here to help
Staff member
Local time
Today, 15:56
Joined
Oct 29, 2018
Messages
21,454
Perfect the allow additions did it. Thanks so much I will close this thread and get back to work on the database Monday.

Cheers to you too!
Have a good weekend. Good luck with your project.
 

Users who are viewing this thread

Top Bottom