DBApprentice
On Error GoTo AWF *****:
- Local time
- Today, 04:29
- Joined
- Dec 24, 2018
- Messages
- 150
Hi,
I spent my entire day trying to sort this out but I am giving up and asking for help::banghead:
I have a small form that will load with all controls locked, except one that the user can enter information to search for a record. The code will change the RecordSource of the form to a string containing the SQL string and if the Dcount > 0 then it requery the form, else he will return a message "no record is found". In addition: I need to prevent the user to dirty the form´s control before a record is populated, I use the locked proprety as default and unlock/lock them ont he fly.
The problem is when the form is populated, dirtied and I run my ResetCode it raises the error raised is the 2105: "You can´t go to the specified record."
After I get th error 2105, then the cmdSearch button starts returning error 2107 every single time I click it: "The value you entered does not meet the validation rule defined for the field or control."
When I use the F8 on the breakpoint, I noticed the code goes from to this event before updating the record source with the SQL string.:
It seems that beforeupdate event is being called too early but I can´t find the solution.
Does anybody know what is going on?
I have a copy of the file attached and the problem is on the frmNewFeedback.
I appreciate all the help!
I spent my entire day trying to sort this out but I am giving up and asking for help::banghead:
I have a small form that will load with all controls locked, except one that the user can enter information to search for a record. The code will change the RecordSource of the form to a string containing the SQL string and if the Dcount > 0 then it requery the form, else he will return a message "no record is found". In addition: I need to prevent the user to dirty the form´s control before a record is populated, I use the locked proprety as default and unlock/lock them ont he fly.
The problem is when the form is populated, dirtied and I run my ResetCode it raises the error raised is the 2105: "You can´t go to the specified record."
After I get th error 2105, then the cmdSearch button starts returning error 2107 every single time I click it: "The value you entered does not meet the validation rule defined for the field or control."
When I use the F8 on the breakpoint, I noticed the code goes from to this event before updating the record source with the SQL string.:
Code:
Private Sub Form_BeforeUpdate(Cancel As Integer)
Dim strMsg As String
If Not blnGood Then Cancel = True
End Sub
Does anybody know what is going on?
I have a copy of the file attached and the problem is on the frmNewFeedback.
I appreciate all the help!