Solved From checkbox from one form to a table not connected with this form (1 Viewer)

knoet

New member
Local time
Today, 16:47
Joined
Mar 5, 2020
Messages
16
I have a form that fills the table Orders.
But on that same form I have a checkbox, this should fill a yes/no field in the table Products and not in the table Orders,how can I do that?
Thanks in advance.
 

June7

AWF VIP
Local time
Today, 06:47
Joined
Mar 9, 2014
Messages
5,470
Why would you need to check a yes/no field in table Products?
 

knoet

New member
Local time
Today, 16:47
Joined
Mar 5, 2020
Messages
16
The quality control departement wants to have the possibility to set a product on hold in the table Products from within the Orders Form (with is connected with Orders table)
 

June7

AWF VIP
Local time
Today, 06:47
Joined
Mar 9, 2014
Messages
5,470
Could multiple users conflict with setting Product on/off hold?

Run an UPDATE action sql to change value in other table.
 

knoet

New member
Local time
Today, 16:47
Joined
Mar 5, 2020
Messages
16
No no multiple users,only chief of quality control
Can you give me a bit more explanation about Update SQL,I am a absolute beginner in Access
 

June7

AWF VIP
Local time
Today, 06:47
Joined
Mar 9, 2014
Messages
5,470
Can use query designer to help construct valid SQL statement. Then VBA can either run that query object or construct SQL statement, something like:

CurrentDb.Execute "UPDATE Products SET checkfield = " & Me.chkHold & " WHERE ID = " & Me.cbxProd

The real trick is figuring out what event to put code into.
 

knoet

New member
Local time
Today, 16:47
Joined
Mar 5, 2020
Messages
16
Thanks, I am a bit confused about Me.chkHold and Me.cbxProd
In the order form I have the checkbox named On_hold, in the Order table there is no Yes/No field
In the Productstable I have a Yes/No field called On hold,there is no checkbox in the products form
 

June7

AWF VIP
Local time
Today, 06:47
Joined
Mar 9, 2014
Messages
5,470
Replace the field and control names I used with whatever your names are.

You didn't mention a Products form before. How is it relevant?

There is an UNBOUND checkbox control on Orders form?
 

Pat Hartman

Super Moderator
Staff member
Local time
Today, 10:47
Joined
Feb 19, 2002
Messages
43,264
You are probably too inexperienced to win an argument with the chief of quality control but this process is illogical. It may be convenient to the chief but in the real world it doesn't make sense. Are you sure he is not asking to put a particular order on hold? It makes sense to add a checkbox (I would actually use a date rather than a checkbox because something called HoldDate not only tells you something is on hold but also when it was marked as on hold) to put an item on an order on hold but that doesn't extend to the product table.

It also makes sense to have the ability to set a product on hold on the product table but that would affect all unfilled orders, not just one. Or, maybe it would affect only new orders and the ones already accepted but not shipped would continue through the normal process. It really depends on the business process that ensues once something is marked "on hold".

Ask the chief what processes this "on hold" flag (which should actually be a date) would affect. You really need more information before you go down this road.
 

Users who are viewing this thread

Top Bottom