Search results

  1. M

    Problem Using Query in VBA

    That works a treat - thank you very much!
  2. M

    Problem Using Query in VBA

    Hi I am trying to execute the following query in my VBA code: sQuery = "select * from tblVerticalTests where ((tblVerticalTests.chrReportID) = '" & Me.cboReportID & "') and ((tblVerticalTests.Airborne/Impact) = 'Airborne')" You will see that tblVerticalTests has a field called...
  3. M

    docmd running before it's supposed to...

    Hi I have the following code: Dim rsWallCons As Recordset sQuery = "select * from tblWallConstructions where ((tblWallConstructions.chrTestID) like '*" & Me.cboReportID & "*')" Set rsWallCons = dbcurr.OpenRecordset(sQuery)...
  4. M

    Creating a new table from a recordset in vba

    Thanks namliam! Any chance you could show me how to delete the table too ;) Thanks again!
  5. M

    Creating a new table from a recordset in vba

    Hi - thanks for that! I tried the following code but get a syntax error.... (Run Time Error 3290 - Syntax error in CREATE TABLE statement) sQuery = "select * from tblLining where ((tblLining.chrOuterBoard) = 'Duraline 13mm' or (tblLining.chrOuterBoard) = 'Fireline 15mm' or...
  6. M

    Creating a new table from a recordset in vba

    Hi I have created a new recordset in my VBA code using a query (i.e. set rs = dbcurr.openrecordset(sQuery) - where sQuery is the query string). is the any way of saving the reultant recordset as a new table? Thanks for your help Mike
  7. M

    .recordcount returning odd values...?

    Cheers Guys Just tried that and it solved the problem! Thanks again! Mike
  8. M

    .recordcount returning odd values...?

    Hi Guys I have the following code: sQuery = "select * from tblBoardChoices where ((tblBoardChoices.intMassPerM2) >= " & intBoard1Low & ")" MsgBox (sQuery) Set rsBoardTypes = dbcurr.OpenRecordset(sQuery) rsBoardTypes.MoveFirst MsgBox (rsBoardTypes.RecordCount)...
  9. M

    Invalid use of NULL (?!!)

    Thats great - thanks guys - I tried namliam's idea first and that worked!
  10. M

    Invalid use of NULL (?!!)

    Hi Can anyone help me with this - I keep getting an error on the line marked *** "Invalid use of NULL". The only way that the code can reach this line is if rsWallCons("intLeafID2").Value is NOT null - how is this possible?!!? If rsWallCons("intLeafID2").Value = Null Then...
  11. M

    Invalid use of NULL (?!!)

    Hi Can anyone help me with this - I keep getting an error on the line marked *** "Invalid use of NULL". The only way that the code can reach this line is if rsWallCons("intLeafID2").Value is NOT null - how is this possible?!!? If rsWallCons("intLeafID2").Value = Null Then...
  12. M

    Error 3061 - Too few parameters - expected 1.

    Thanks guys - that really helped! Mike PS thanks for the tips Namliam!
  13. M

    Error 3061 - Too few parameters - expected 1.

    Hi When executing the following SQL statement in VBA... Private Function createAdverseDeviationsString(strTestID As String) As String Dim dbcurr As Database Set dbcurr = DBEngine.Workspaces(0).Databases(0) Dim sQuery As String sQuery = "select * from...
  14. M

    Form Buttons No Longer Working!

    Hi Guys This one is resolved now - It seemed to me that somehow the form had lost the link to the VBA code so I created a new button and created an event for that and everything started working again - Bizarre! Mike
  15. M

    Form Buttons No Longer Working!

    Also this extra information came with the error :D This error occurs when an event has failed to run because Microsoft Office Access cannot evaluate the location of the logic for the event. For example, if the OnOpen property of a form is set to =[Field], this error occurs because Access...
  16. M

    Form Buttons No Longer Working!

    Hi Paul I haven't put in any error handling into my code - the script was working fine yesterday, but suddenly stopped working without me making any changes! All the buttons and events on the form seem to be affected :mad: Is there any other way to find out what might be causing the error...
  17. M

    Form Buttons No Longer Working!

    Hi I was wondering if anyone can help with the following error that keeps on reoccurring. Out of the blue - all the buttons on one of my forms have stopped working and keep coming up with an error: the expression OnClick you entered as the event property setting produced the following error...
  18. M

    Form Buttons No Longer Working!

    Hi I was wondering if anyone can help with the following error that keeps on reoccurring. Out of the blue - all the buttons on one of my forms have stopped working and keep coming up with an error: the expression OnClick you entered as the event property setting produced the following error...
  19. M

    rs.movefirst doesn't seem to move to the first record

    Hi I have a table that has primary key Id in text format. When I use the movefirst method and assign rs!keyID to a variable, the variable value is not the first record as it appears in the table... Does anyone have any idea why this is? Thanks in advance for your help Mike Wood
  20. M

    How do you delete the contents of a table using VBA?

    Hi I would like to delete the contents of one of my tables in the database using code. Does anyone know how to do this. Table is already declared with the following code... Dim dbCurr As Database Set dbCurr = DBEngine.Workspaces(0).Databases(0) Dim rsTableTest As Recordset Set...
Back
Top Bottom