Search results

  1. 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...
  2. 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)...
  3. 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
  4. 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)...
  5. 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...
  6. 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...
  7. 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...
  8. 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...
  9. 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...
  10. 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
  11. 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...
  12. M

    Writing a table to a word document

    Hi Can anyone help with this... I've want to write the contents of a table to a word document so that the information appears as a table in the document. The code below opens a template and writes each row from the table on a different line (fields on the same row are tab separated)...
  13. M

    Question Using form data to create a word document

    Hi I hope the following question makes sense.... Does anyone know if the is any way of copying the contents of a table into a word document. I would like to do this in VBA so that when a button is clicked on a form this action is performed. Thanks for your help Mike Wood:confused:
  14. M

    Problem with Split() function delimiters...

    Hi I've got a small problem with the parsing data using the split() function. The code below functions when the "PasteClipBoard" button is pressed. The code pastes the results in the box and uses the split function to put each value into 22.2, 32.1 etc into each field of the array...
  15. M

    Data entry field where I can paste a list?

    Hello Everyone I don't know whether this is possible but, I am creating a data entry form and it would be helpful to be able to paste contents of a column in excel into a field in my form (to save typing the data in cell by cell). Is this possible? If so, can you suggest how I might go about...
  16. M

    If loop problem

    Hi I am trying to get my form to have a pop up box if there is nothing entered into one of the text boxes. I have tried the following code, but it doesnt seem to be working!? anyone any ideas? If Me.txtReportID = "" Then MsgBox ("Report ID field is empty. Please enter a new ID...
  17. M

    Using VBA to Control Combo Boxes

    Hi I would like to use a combo box in a form, but would like to control the contents using VBA code. Im not sure how to get started - can anyone give me an example of how to populate a combo box from another table in the database? (I know that this can be done using queries - but I need more...
  18. M

    docmd.Close won't close... sometimes

    Hi I have a save button on my form which when clicked adds a record to a form, then closes the form. I thought the following code would work: Private Sub save_Click() AddRecord DoCmd.close End Sub However, it adds the record and doesnt close the form... if I comment out the...
  19. M

    Refering to Unbound Text Boxes on Form

    Hi Could anyone please tell me how to refer to the data entered into a text box on an unbound form. For example if I want to manipulate the string written into a text box by the user, what variable to I use to the string (eg if my box is called TextBox). Thanks for your help! Mike
  20. M

    Help! Form not updating data!

    Hello! I have created a form with bound fields to enter data into several tables in my database. The form need to update 2 records in one table (tblWallLeaves) and update the IDs in the table tblWallConstructions. One wall construction can have many leaves (usually up to 2) and each leaf...
Back
Top Bottom