Hello,
Can you please help me to figure why is giving me this error: Syntax Error(Missing Operator) in query expression '()'
What I am trying to do is when user clicks Save, the system will firstly remove all bank holidays in the holiday Flatfile table (for selected country) and replace with what's in the list (selected country). Thank you. -
-
Dim Response
-
Dim rstFF As Recordset
-
Dim rstAllocated As Recordset
-
Dim rstPH As Recordset
-
Dim rstEmployee As Recordset
-
Dim rstAttend As Recordset
-
-
Dim strFF As String
-
Dim strAllocated As String
-
Dim strPH As String
-
Dim strEmployee As String
-
Dim strAttend As String
-
Dim sSearch As String
-
-
-
-
If Me.cboCountry = "BE" Then
-
-
'first remove all entries and update with defaults
-
strFF = "Select * from tbl_HolidayTracker_Flatfile order by [AttendDate]"
-
-
'Debug.Print strFF
-
-
Set rstFF = CurrentDb.OpenRecordset(strFF, dbOpenDynaset, dbSeeChanges)
-
If rstFF.RecordCount > 0 Then
-
rstFF.MoveLast
-
rstFF.MoveFirst
-
-
While Not rstFF.EOF
-
-
rstFF.Edit
-
-
rstFF![Contr Hrs] = Format(rstEmployee![FTE % hours per day], "0.00")
-
rstFF![SDP Hrs] = Format(rstAllocated![Standard hours per day] * rstAllocated![SDP], "0.00")
-
rstFF![Other Hrs] = Format(rstAllocated![Standard hours per day] * rstAllocated![Other], "0.00")
-
rstFF![Hours] = Format(rstFF![SDP Hrs] + rstFF![Other Hrs], "0.00")
-
rstFF![Activity] = "A"
-
rstFF![%FTE] = rstEmployee![% FTE] * 100
-
-
rstFF.Update
-
-
rstFF.MoveNext
-
Wend
-
-
End If
-
-
rstFF.Close
-
Set rstFF = Nothing
-
-
'Now update with new values
-
strFF = "Select * from tbl_HolidayTracker_Flatfile where [Location]='" & Me.cboCountry.Column(1, Me.cboCountry.ListIndex) & "'"
-
Set rstFF = CurrentDb.OpenRecordset(strFF, dbOpenDynaset, dbSeeChanges)
-
If rstFF.RecordCount > 0 Then
-
rstFF.MoveLast
-
rstFF.MoveFirst
-
-
While Not rstFF.EOF
-
-
rstFF.Edit
-
-
rstFF![Contr Hrs] = Format(rstEmployee![FTE % hours per day], "0.00")
-
rstFF![SDP Hrs] = Format(rstAllocated![Standard hours per day] * rstAllocated![SDP], "0.00")
-
rstFF![Other Hrs] = Format(rstAllocated![Standard hours per day] * rstAllocated![Other], "0.00")
-
rstFF![%FTE] = rstEmployee![% FTE] * 100
-
-
-
If Me.cboCountry = "BE" Then
-
If InStr(1, Me.cboCountry, "A") = 1 Then
-
rstFF![Hours] = Format(DLookup("[Hours]", "tbl_Register_Hours", "[HoursType]='" & Me.cboCountry & "' and [CountryCode]='" & rstEmployee!Location & "'"), "0.00")
-
rstFF![Activity] = "A"
-
End If
-
-
rstAttend.AddNew
-
rstAttend!EmployeeID = rstEmployee!EmployeeID
-
rstAttend!Attend = Me.cboCountry
-
rstAttend![Date] = rstFF!AttendDate
-
rstAttend.Update
-
-
End If
-
-
rstFF.Update
-
-
rstFF.MoveNext
-
Wend
-
-
End If
-
-
rstFF.Close
-
rstEmployee.Close
-
rstAllocated.Close
-
rstAttend.Close
-
rstPH.Close
-
End If
-
-
Neither have you set rstAllocated to anything. These will both cause such an error to pop up.
Have you included the entire procedure? Or am I missing something?
5 1266
On what line do you get this error?
The error message is gone now what I am receiving on line 34 is "Object variable or With block not set.
I don't see anywhere that you have set rstEmployee to anything. This will throw the described error.
Hello twinnyfo
I know it's missing as rstAllocated, I am trying to simplify this exercise, but it's getting a mess for me. Thank you.
Neither have you set rstAllocated to anything. These will both cause such an error to pop up.
Have you included the entire procedure? Or am I missing something?
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Jack |
last post by:
Hi,
I am trying to use the following code to make the save button invisible in
the asp form when the checkbox is either on or the session variable has a
particular value.
THE CODE IS AS FOLLOWS:...
|
by: C Watson |
last post by:
Hi,
I'm wondering if anyone can help me with AJAX in ASP.NET 1.1. I have a very
specific feature that I would like to use it for.
I have a rather long form that the users use to enter data...
|
by: Rick Shaw |
last post by:
Hi, can anyone help? I am fairly new to C# and need help with a
functionlity in my app. What I need to accomplish is to be able to enable
the SAVE button as soon as the user modifies a data in...
|
by: toddw607 |
last post by:
Hi all!
I am attempting to bring an SQL Server table into ASP.NET using the datagrid . I have set all cells to be a text box by which the user can just click on and edit the cell. I have a...
|
by: Eric |
last post by:
Hi,
I have a form that requires a save button to be clicked before closing
the form. I would like a msgbox to pop up when the button is not
clicked before closing. Can someone show me how i...
|
by: Whasigga |
last post by:
Hi
I've created a form that has 7 subforms. It is the same subform, bound to a table, just repeated. This form represents a week, and each subform is used to enter in data for each day of the...
|
by: QCLee |
last post by:
Hello Sir, Im here again asking for help. I have a form and a subform relate to HVAC Windward Table. i have a SAVE button on the form that when clicked it saves data on the HVAC Windward Table but...
|
by: squrel |
last post by:
Hello everyone,
I m using some button using toolbar such as Add,Save,View,.... my save button is not working.... it doesnt give me any error but does not save to my database.... or showing in my...
|
by: maheshmrk22 |
last post by:
Hi,
I have a gridview and inside that "select" button in Template column to which i have added command and that handling it in RowCommand Event of grid..
I have added attribute to that button...
|
by: amme |
last post by:
i am beginner in MS Access i want to save entries on form(named: MDF) through a save button if form field "Primary Cable" (indexed with other field Primary Cable Pair) have duplicate value then on...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new...
| |