lacampeona
Registered User.
- Local time
- Today, 15:19
- Joined
- Dec 28, 2015
- Messages
- 392
Hello experts
I have some problems.
I have a form with several combo boxes and text boxes. I am using validation rule for saving the records.
I have a problem with one combobox who is updating the status of the status field. ( user can choose 5 different statuses). Here I am using the UPDATE statement.
When user wants to save the record and all the fields are filled correctly everythink is perfect.
But when user want to make me problems and lets say he only choose a combobox named Status and nothing else and user close the form then the field status is automaticly updated. The validation rule is working perfectly and user get a message if he want to save the record or not.
Users says no to saving the record and record is not saved but the field status is alredy updated ( becouse the combobox status has a UPDATE statment) and status is changed.What happens is that in the table I do not have record saved ( that is what I want) but the status is changed ( I dont want that becouse he did not fill all the fields).
How to prevent that user choose the status field before all the fields are entered?
I try sometnhing with combobox enabled and disabled butif I use that the problems stay. I need to prevent the update statement.
Here is my thinking what can user do:
1. User open the form and lets say he make a mistake and choose the combobox status and then close the form without saving.( He say no, I do not want to save the record-validation rule working ok), but the record is already updated becouse I have a UPDATE code in that combobox?
How to prevent that? I dont want to status be changed before all the field are filled.
Or where I have to put the update statment so the combobox will not update data before all the fields are filled?
How to prevent update data before all the fields are entered? hmmm
What is yours suggestion? What is the correct way to do that?
Thanks is advance
For Updating data in the field status I am using the next code.
I try also to combine validation rule but I dont have success...hmm
I have some problems.
I have a form with several combo boxes and text boxes. I am using validation rule for saving the records.
I have a problem with one combobox who is updating the status of the status field. ( user can choose 5 different statuses). Here I am using the UPDATE statement.
When user wants to save the record and all the fields are filled correctly everythink is perfect.
But when user want to make me problems and lets say he only choose a combobox named Status and nothing else and user close the form then the field status is automaticly updated. The validation rule is working perfectly and user get a message if he want to save the record or not.
Users says no to saving the record and record is not saved but the field status is alredy updated ( becouse the combobox status has a UPDATE statment) and status is changed.What happens is that in the table I do not have record saved ( that is what I want) but the status is changed ( I dont want that becouse he did not fill all the fields).
How to prevent that user choose the status field before all the fields are entered?
I try sometnhing with combobox enabled and disabled butif I use that the problems stay. I need to prevent the update statement.
Here is my thinking what can user do:
1. User open the form and lets say he make a mistake and choose the combobox status and then close the form without saving.( He say no, I do not want to save the record-validation rule working ok), but the record is already updated becouse I have a UPDATE code in that combobox?
How to prevent that? I dont want to status be changed before all the field are filled.
Or where I have to put the update statment so the combobox will not update data before all the fields are filled?
How to prevent update data before all the fields are entered? hmmm
What is yours suggestion? What is the correct way to do that?
Thanks is advance
For Updating data in the field status I am using the next code.
If Me.StatusKoloneStanje = "(2) VUporabi" Then
'Me.AnalizaUstreza = "N/A"
DoCmd.RunSQL "UPDATE tblKolone2 SET tblKolone2.StatusKolone= '(2) VUporabi' WHERE tblKolone2.ID = " & Me.ID
'DoCmd.RunSQL "UPDATE tblKolone2 SET tblKolone2.AnalizaUstreza= 'N/A' WHERE tblKolone2.ID = " & Me.ID
DoCmd.SetWarnings (True)
End If
I try also to combine validation rule but I dont have success...hmm
If ValidateForm(Me, "required") = False Then
Cancel = True
Else
DoCmd.OpenForm "frmKoloneUporabaSignOffSub"
End If