Search results

  1. A

    Report from combobox

    Hi all It's been a while since I've posted on here (feels like confession). I am trying to get a report based on a selection from a combobox. The issue is many fold. Firstly I have been playing around with it so much that I have messed up the syntax and can't remember what I had. Here is what...
  2. A

    Date module

    I have a quick question I am trying to call a module (clsWorkingDays) and calculate 7 days before another date. this is my first attemot at module use and I'm not sure what i'm doing so far I have; Dim clsWorkingDays As Workdays Set Workdays = New Workdays If Me.cmboCommunicationName.Value...
  3. A

    Dlookup with date

    I have posted this on another access forum but thought i'd try here too. I am writing some code for a combobox on click event. I need to check the date that has been selected in the combobox against a table (tblEventDelegates) that holds a list of delegates who have been scheduled onto events...
  4. A

    Dcount problem

    I have a DCount on a textbox on a form that is supposed to pull up the number of delegates scheduled or invited (status 1 or 2) form a table tbleventdelegate. I have the following code: =DCount("[Status]","tblEventDelegate","[EventID]=" & [Forms]...
  5. A

    Too few parameters expected 1

    I have the above error come up on the following piece of code on the highlighted line: Dim Rs4 As DAO.Recordset Set Rs4 = CurrentDb.OpenRecordset("Select * From tblFacultyEvent Where FacultyID = " & Me.cmboFacultyEvent & " And EventEndDay= " & Format(Me.Parent!EventEndDate...
  6. A

    Syntax missing operator error

    I have a syntax error on the following code: If Me!SubTeamHeadDelID = Me!DelegateID Then Dim strID As String Dim strID2 As String Debug.Print SubTeamParentID Debug.Print SubTeam strID = DLookup("SubTeamParentID", "tblSubTeam", "SubTeam = " & Me!SubTeam) If strID = Null Then MsgBox "You...
  7. A

    Form field from two tables

    I have a textbox on a form that displays the venueroomID of a venue room that has been selected prior and stored in a tblEvent. This works fine and is on the form so that the user willknow if a room has already been selected and therefore won't select another. I now need to display the actual...
  8. A

    IIf on textbox

    I am trying to write a piece of code that will show me an ID number from a table if certain criteria is met. The code I have so far is: = IIf(DLookUp( [tblSubTeam]![SubTeamHeadDelID] ,[tblSubTeam], = [DelegateID])), [tblSubTeam]![SubTeamParentID] , [tblSubTeam]![SubTeamHeadDelID] this is on...
  9. A

    Error communicating with ActiveX etc

    I have built some code which might or might not work as i can't test it because the error message above comes up. The code itself is If Me!SubTeamHeadDelID = Me!DelegateID Then Dim strID As String Dim strID2 As String strID = Nz(DLookup("SubTeamParentID", "tblSubTeam", "SubTeam =" &...
  10. A

    Subform control query

    I have posted this on another board in case anyone sees it and thinks they have seen it before but I thought I'd try here as well. I have a query that runs from a subform on the onclick (this may be changed to elsewhere later) The query runs from a subform combobox and runs Ok apart from...
  11. A

    valiadation rule violation (again)

    I have a update query running from the afterupdate on a cascading combobox which is really throwing me. The query is very basic: INSERT INTO tblEvent ( VenueRoomID ) VALUES (Forms!frmEvent!cmboVenueRoom); but it gives me the above error. I have checked all the usual violations like required...
  12. A

    +1 in update query

    Is it possible to +1 to a table field using an update query I have the following query: INSERT INTO tblEvent ( PlacesAvailable, EventDurationDays ) VALUES (+1, [Forms]![frmEvent]![EventDurationDays]); which gives me a validation rule violation I imagine its on the +1 part as I don't know...
  13. A

    If... VBA code

    I have a piece of code (shown below) that is supposed to look at a field on a form (Me.ScheduledNumber) and compare it to another field (Me.CourseMInDel and Me.CourseMaxDel) and compare the values and give a message to the user if the results are, in the first case less than the CourseMInDel and...
  14. A

    Form control and table records

    This seems such a basic thing to do but I can't get my head round it (maybe I'm thinking about it too much). I have a form that has a combobox based on another combobox (cascading) when I select a record in the second box it puts this in the table. I switch between and can see this. I then want...
  15. A

    Query based on subform combobox

    I am trying to build a query based on a combobox that is on a subform that cascades from a combobox on a main form. So far I have : INSERT INTO tblSubTeamEvent ( SubTeamID, EventID ) VALUES (Me!SubFormSubTeamForm.Form!cmboSubTeamSF, [Forms]![frmEvent]![EventID]); but when I run it it asks for...
  16. A

    Listbox advice needed

    Morning all I have an unbound listbox on a form that is populated based on a combobox. The listbox is simple multi select and I want the user to select one or more items off this and then store that information in a table.This is the first issue I'm having: I have a query that partly works that...
  17. A

    "Method 'item' of object 'forms' failed.

    I have a form (EventComms1) with a subform (Communcation subform)that when I select an item from the combobox (cmboCommunicationName) should update a date field (CommunicationDueDate) on my subform based on the date on the main form (EventTimeStartDay) but it says the "Method 'item' of object...
  18. A

    Combining 2 recordsets

    I am trying to run two recordset queries that produce different results but from the same table. The first one works but I can't get the second to work I don't know whether I need to run both at the same time or if there is something I need to add: Dim Rs As DAO.Recordset Set Rs =...
  19. A

    textbox controlsource and cascading combobox

    I have a form that has two cascading comboboxes I need to display a field from the table that corresponds to the result of the second unbound combobox in an unbound textbox. To explain further I have a combo that gives a selection of courseIDs and then the second combo gives a list of EventIDs...
  20. A

    Type mismatch on combobox

    Still more VBA solving for me to do. I can't work out why I am getting a type mismatch on this piece of code: Private Sub EventStatus_Change() If (Me.EventStatus.Value = 3) And (Me.ScheduledNumber > 0) Then MsgBox "There are already delegates scheduled on this event. Please inform the...
Top Bottom