A CheckBox that changes the value in the ComboBox (1 Viewer)

DREAMERMX

Registered User.
Local time
Today, 09:06
Joined
Aug 14, 2013
Messages
20
Hello everyone!


I have a form with a combo box (it has two states (In process / On file)) and a checkbox and I need that when the checkbox is checked, change the status of the combo box ...

The combobox and checkbox are in different tables (Assigned and Movements, respectively) and refer to different types of data.

The checkbox Refers to a set of tasks FINISHED, then, if that's the case, They must change the values ​​of the ComboBox That has two values ​​or options (In process / On file). Note: These two values ​​are searched fields in a table "Status", and searches for values ​​in a table with the wizard searches

For example: While ComboBox contained in "In Process", the checkbox is unchecked and if this "On File" checkbox is marked



I hope you can help me.
Thank you!
 

GohDiamond

"Access- Imagineer that!"
Local time
Today, 12:06
Joined
Nov 1, 2006
Messages
550
Is the selected value of the combobox saved in a table for each record as either "In Process" or "On File"? and do you want the state of the checkbox to effectively change the combobox.value which is stored in the table?
 

MarkK

bit cruncher
Local time
Today, 09:06
Joined
Mar 17, 2004
Messages
8,180
The problem with this idea is that you create an undocumented dependency in your data. You'll write this process into a form, let's say, and the only way this dependency is enforced is if that particular form is used. Every other way this data might be updated will by-pass this, essentially hidden, requirement.

What you are essentially doing is storing the same data in two different places, and you are processing it a storage time. What happens when these two data points are in conflict? Which is the authoritative version?

Store data raw. Store it in one place. Process it when you retrieve it.

hth
 

DREAMERMX

Registered User.
Local time
Today, 09:06
Joined
Aug 14, 2013
Messages
20
Hi, thanks for responding!

Yes, Combobox selected value is stored in a table for each record. and yes, I want one is the reflection of the other ... can be done?
 

DREAMERMX

Registered User.
Local time
Today, 09:06
Joined
Aug 14, 2013
Messages
20
Is the selected value of the combobox saved in a table for each record as either "In Process" or "On File"? and do you want the state of the checkbox to effectively change the combobox.value which is stored in the table?
----------------------------------------------------------------------------------------

Hi, thanks for responding!

Yes, Combobox selected value is stored in a table for each record. and yes, I want one is the reflection of the other ... can be done?
 

DREAMERMX

Registered User.
Local time
Today, 09:06
Joined
Aug 14, 2013
Messages
20
Take this opportunity to ask a question related ..

How do I make: if the checkbox is marked, requires the user to place the date in a date field that is in the same form?
 

GohDiamond

"Access- Imagineer that!"
Local time
Today, 12:06
Joined
Nov 1, 2006
Messages
550
There is a way to do most anything, wheter it's adviseable or not is always up for discussion/argument... anyway:
If you place your checkbox on any form and that form has a reference to a unique ID in the table where the combobox data is stored you could use the afterupdate event of the checkbox to run an sql statement to update the field in the record in the related table.
if checkbox.value = -1 then
strsql = UPDATE Tablewithcomboboxdata SET Tablewithcomboboxdata .[YourField] = "YourState"
WHERE (((Tablewithcomboboxdata .[YourField])="Reference_ID"));

docmd.runsql strsql
elseif checkbox.value = -1 then
strsql = UPDATE Tablewithcomboboxdata SET Tablewithcomboboxdata .[YourField] = "YourOtherState"
WHERE (((Tablewithcomboboxdata .[YourField])="Reference_ID"));

docmd.runsql strsql
Endif

Sorry I can't be more specific, but I think you can figure it out from here.

CHeers
Goh
 

spikepl

Eledittingent Beliped
Local time
Today, 18:06
Joined
Nov 3, 2010
Messages
6,142
@Dreamermx
Pay attention to what Mark said in #3. You seem to want to proceed despite his advice, but you have so far not explained why you wish to store the same information in two places and thus in two different ways.
 

DREAMERMX

Registered User.
Local time
Today, 09:06
Joined
Aug 14, 2013
Messages
20
Thank you all for your answers! I screw around with this and I got to thinking .. and ...

I do not know if I expressed myself very badly, but I did this and it worked


Private Sub Complete_Click()
If Complete.Value = -1 Then
Me.STATUS= 2
Else
Me.STATUS= 1
End If
End Sub


this can bring any complications??

Sorry but I'm NEWBIE
 

Users who are viewing this thread

Top Bottom