Run time error 3705 - Syntex error (Missing operator) in que
-
- StarLounger
- Posts: 82
- Joined: 13 Nov 2013, 19:28
Re: Run time error 3705 - Syntex error (Missing operator) in
How i can do the same for all other fields? because for each field i need to create a user entry restriction.
-
- gamma jay
- Posts: 25455
- Joined: 17 Mar 2010, 17:33
- Location: Cape Town
Re: Run time error 3705 - Syntex error (Missing operator) in
Sounds like you need a For Each loop to test each control inside the forms BeforeUpdate event.
Something in the form of the code in this thread by John "Big Booty"
Just a idea.
Something in the form of the code in this thread by John "Big Booty"
Just a idea.
Regards,
Rudi
If your absence does not affect them, your presence didn't matter.
Rudi
If your absence does not affect them, your presence didn't matter.
-
- StarLounger
- Posts: 82
- Joined: 13 Nov 2013, 19:28
Re: Run time error 3705 - Syntex error (Missing operator) in
Thanks for the example. But my case is different . But i got an idea like in the after update event for each field i will make all other field locked then once filled up then i can activate the fields to fill up. but my assumption is i already have that code but still i cannot able achieve what i needed.. lets see what i got it end of my codes.
-
- Administrator
- Posts: 78558
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: Run time error 3705 - Syntex error (Missing operator) in
Since the conditions for each control are different from those for the others, you'll have to write code for each of those controls separately. And since only you know exactly what the conditions are, we cannot write the code for you.
Personally, I wouldn't bother since I think it's too much work. I'd rely on the form's Before Update event to check all the conditions. If that's not acceptable to you, that is fine, but it means that you will have to write a LOT of code.
Personally, I wouldn't bother since I think it's too much work. I'd rely on the form's Before Update event to check all the conditions. If that's not acceptable to you, that is fine, but it means that you will have to write a LOT of code.
Best wishes,
Hans
Hans
-
- StarLounger
- Posts: 82
- Joined: 13 Nov 2013, 19:28
Re: Run time error 3705 - Syntex error (Missing operator) in
Yes I understood that its lot of codes need to written. Now before update event is working fine.
Can you give one sample code for how we can restrict user not to skip the fields. That's only one request from me. If you have provided then I would write codes myself.
Can you give one sample code for how we can restrict user not to skip the fields. That's only one request from me. If you have provided then I would write codes myself.
-
- Administrator
- Posts: 78558
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: Run time error 3705 - Syntex error (Missing operator) in
We're going round in circles. The form's On Current event locks all controls that shouldn't be filled in before the preceding ones have been filled. The After Update event of the individual controls unlock the next control if appropriate.
Together with the form's Before Update event for a final check, that's all you need. So I don't see what code I should provide.
Together with the form's Before Update event for a final check, that's all you need. So I don't see what code I should provide.
Best wishes,
Hans
Hans
-
- StarLounger
- Posts: 82
- Joined: 13 Nov 2013, 19:28
Re: Run time error 3705 - Syntex error (Missing operator) in
Then please provide me the codes for lock in all controls that would fine for me.
-
- Administrator
- Posts: 78558
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: Run time error 3705 - Syntex error (Missing operator) in
But you already have that code in the On Current event procedure that I posted earlier in this thread!
Best wishes,
Hans
Hans
-
- StarLounger
- Posts: 82
- Joined: 13 Nov 2013, 19:28
Re: Run time error 3705 - Syntex error (Missing operator) in
OK as per your suggestion I will lock all the fields in the current event then once each field filled up using after update event I will enable the next field. So now I need to create each field after update event only.
Thanks for all your help. Really appreciated.
Thanks for all your help. Really appreciated.
-
- StarLounger
- Posts: 82
- Joined: 13 Nov 2013, 19:28
Re: Run time error 3705 - Syntex error (Missing operator) in
It work like a charm thank you so much for your patience and explanation. Let me give and test it with users. You have saved me. :)
-
- StarLounger
- Posts: 82
- Joined: 13 Nov 2013, 19:28
Re: Run time error 3705 - Syntex error (Missing operator) in
Hi Hans,
One final help from you if user enter into main form and add new record and come back to main form the newly added record is not appearing on the search form how I can do the refresh automatically. I have tried me.requery in the main form but still its not working. The same problem I face while exporting the data into excel. Because its missing the newly enter data's.
Please help...
One final help from you if user enter into main form and add new record and come back to main form the newly added record is not appearing on the search form how I can do the refresh automatically. I have tried me.requery in the main form but still its not working. The same problem I face while exporting the data into excel. Because its missing the newly enter data's.
Please help...
-
- gamma jay
- Posts: 25455
- Joined: 17 Mar 2010, 17:33
- Location: Cape Town
Re: Run time error 3705 - Syntex error (Missing operator) in
You would either have to close the Main Form, or navigate to a new or previous record so that the new record gets written to the table first before it will appear in the search form. If you are dealing with VBA code it looks like the update method can work. Try something like this:
Code: Select all
Set mydb = CurrentDb()
Set rst = mydb.OpenRecordset("Table Name")
...
rst.Update
rst.Close
Regards,
Rudi
If your absence does not affect them, your presence didn't matter.
Rudi
If your absence does not affect them, your presence didn't matter.
-
- StarLounger
- Posts: 82
- Joined: 13 Nov 2013, 19:28
Re: Run time error 3705 - Syntex error (Missing operator) in
Your correct but without closing the main form how I can refresh the data. Its like user will see the home form from there they will go into data entry form once they are done with data entry they will come back to home form. Without closing and reopen the open form can we do the refresh the data and get the new records in home form?
-
- StarLounger
- Posts: 82
- Joined: 13 Nov 2013, 19:28
Re: Run time error 3705 - Syntex error (Missing operator) in
I got an error on the codes you have provided how I can declare the mydb as ?
I have declared rest as dao.recordset
What about my dB?
I have declared rest as dao.recordset
What about my dB?
-
- Administrator
- Posts: 78558
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: Run time error 3705 - Syntex error (Missing operator) in
Instead of using Rudi's code, change the On Click event procedure for the Add_New_Record button to
Code: Select all
Private Sub Add_New_Record_Click()
DoCmd.OpenForm FormName:="Master_data", DataMode:=acFormAdd, WindowMode:=acDialog
Me.CmbTendor.Requery
CmbTendor_AfterUpdate
End Sub
Best wishes,
Hans
Hans
-
- StarLounger
- Posts: 82
- Joined: 13 Nov 2013, 19:28
Re: Run time error 3705 - Syntex error (Missing operator) in
Thanks for this. But I am getting error on form current event because we have code looking cb submission I'd criteria there but when we enter new record there is no cb submission is selection so its giving error of invalid use of null.
-
- StarLounger
- Posts: 82
- Joined: 13 Nov 2013, 19:28
Re: Run time error 3705 - Syntex error (Missing operator) in
I think on the form current we need to give additional criteria for new records so that it will work only when editing records
-
- Administrator
- Posts: 78558
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: Run time error 3705 - Syntex error (Missing operator) in
You can add a line at the beginning of the On Current event of the Master_Data form:
or you can replace Me.CB_SubmissionID with Nz(Me.CB_SubmissionID,0)
Code: Select all
If Me.NewRecord Then Exit Sub
Best wishes,
Hans
Hans
-
- StarLounger
- Posts: 82
- Joined: 13 Nov 2013, 19:28
Re: Run time error 3705 - Syntex error (Missing operator) in
I have used the me.new record code there.
One more clarification I have changed tender_no field into number format so in the after update event of CMB tendor showing data type mismatch because its referring the text values
Me.cmbSAPReqNo.RowSource = "SELECT DISTINCT Requisition_table.SAP_Requisition_Numbers FROM Requisition_table WHERE Tender_NO = '" & Me.CmbTendor & "'"
Do I need to remove the double quotes here to make it as number field.?
One more clarification I have changed tender_no field into number format so in the after update event of CMB tendor showing data type mismatch because its referring the text values
Me.cmbSAPReqNo.RowSource = "SELECT DISTINCT Requisition_table.SAP_Requisition_Numbers FROM Requisition_table WHERE Tender_NO = '" & Me.CmbTendor & "'"
Do I need to remove the double quotes here to make it as number field.?
-
- Administrator
- Posts: 78558
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: Run time error 3705 - Syntex error (Missing operator) in
Change it to
Me.cmbSAPReqNo.RowSource = "SELECT DISTINCT Requisition_table.SAP_Requisition_Numbers FROM Requisition_table WHERE Tender_NO = " & Me.CmbTendor
Me.cmbSAPReqNo.RowSource = "SELECT DISTINCT Requisition_table.SAP_Requisition_Numbers FROM Requisition_table WHERE Tender_NO = " & Me.CmbTendor
Best wishes,
Hans
Hans