User Profile
Collapse
-
Multiple counts
Hi,
How can you count x and y as seperate counts from the same field?
i.e. A table has the field Gender and I want to have one count which counts the number of records with 'male' as the gender' and another count which counts 'female' as the gender?
Any help will be very much appreciated -
The references were the problem, thanks very much for your helpLeave a comment:
-
Thanks for the post, it makes sense what you're saying. Although I've completely stripped the query back to something very basic and it still doesn't like OpenRecordset. There is something else more underlying which is causing the error (the solution you gave probably solved what would have been a preceeding error once this one was corrected).
I've stripped the code back to: -
...Code:Dim db As DAO.Database Dim Rs As
Leave a comment:
-
Hi,
I've got a similar problem to the one in this post which was solved.
My error returned is "Invalid Argument" and it points to the line where OpenRecordset is used.
My code is: -
...Code:Private Sub Command26_Click() Dim test As Database Dim Rs As DAO.Recordset Dim Msg As String Dim bFlag As Boolean Set Rs = CurrentDb.OpenRecordset("SELECTLeave a comment:
-
Is there a way that the two queries can be brought together as one?
ThanksLeave a comment:
-
Didn't know you could do a query on a query, Genious!!
Thanks very much for you help...Leave a comment:
-
SQL Query
Hi,
I've generated a query using the query builder in Access and it has generater the following: -
...Code:SELECT tblBooking.Booking_Date, tblBooking.Booking_Type, tblBooking_Time_Slot.Booking_Time_Slot, tblEmployee.Employee_Name FROM tblEmployee INNER JOIN (tblBooking INNER JOIN (tblBooking_Time_Slot INNER JOIN tblBooking_Slot ON tblBooking_Time_Slot.Booking_Time_Slot_ID = tblBooking_Slot.Booking_Time_Slot_ID)
-
SQL query to return 1 record from multiple similar records
Hi,
I’ve setup a table which contains records with multiple duplicated time fields (tblTime_Slots)
i.e.
ID Time_Slot
1 08:00
2 08:00
3 09:00
4 09:00
etc…
I want to bring back the Time_Slots in a combo box, but rather than bringing back each Time_slot twice I want to write an SQL query that will only display each Time_Slot once.
i.e.... -
Thanks very much, it's a good solution to the problem and makes sense. Having made a few tweaks here and there it now works perfectly.
Thanks again...Leave a comment:
-
An event within an event
Hi,
I want to put an event within an event but it seems as though this can't be done and I need to figure a work around. Basically I am trying to say that if the user clicks on the 'cmdRenewTraini ng' button then it just saves the record without the prompt asking if they wish to save. If they dont press the 'cmdRenewTraini ng' button then I want the prompt to ask them if they want to save changes. The code looks to make sense but I think... -
Sorted it, just added the AND statement at the end of the script I previously had, and also used a query to refer to the Still_With_Comp any checkbox from a linked table as you advised.
Many thanks for the point in the right direction....Leave a comment:
-
Hi, how would I add the criteria for the checkbox, would it be as simple as using another AND statement at the end? i.e.
Thanks,...Code:intStore = DCount("[Training_ID]", "[qryTrainingGiven]", "[Training_Renewal_Date] <=Now() AND [Training_Renewed?] =0 AND checkbox = true")Leave a comment:
-
DCount within VBScript in Access
Hi,
I'm having a little trouble with some VB code within Access.
I have the following code which assigns a DCount to an integer: -
It basically counts the number of records which have a Training_Renewa l_Date which is previous to todays date....Code:intStore = DCount("[Training_ID]", "[tblTrainingGiven]", "[Training_Renewal_Date] <=Now() AND [Training_Renewed?] =0") -
Hi S7,
Thanks for your quick response, the majority of it makes sense and it looks as though it covers everything needed. However when I click on the checkbox which contains the code is brings back the error message: -
MS Access can't append all the records in the append query....and it didn't add 1 record to the table due to key violations
The code it is getting stuck on is as follows: -
...Leave a comment:
-
Complex booking form using VBA code
Hi,
I have a form in Access 2000 running Windows XP with the following fields: -
Booking_ID
Date
Person_Name
Booking_Type
8-9am (y/n checkbox)
9-10am (y/n checkbox)
10-11am (y/n checkbox)
11-12am (y/n checkbox)
I'm trying to write some VBA code which for any given date only allows a max of 3 bookings each for the two timeslots 8-9am and 9-10am, and a max...
No activity results to display
Show More
Leave a comment: