Search results

  1. c_smithwick

    Query with Criteria export to excel HELP...

    Try the following Set rstCountOrders = dbSample.OpenRecordset(qdfMyQuery.SQL, dbOpenDynaset)
  2. c_smithwick

    Images in access

    If you absolutely must store the images in access, you can set up a table with a field of type OLE Object and use the following code to read/write the binary information for the image file to the database. This will make your database portable. You can use the "ReadBLOB" function to read the...
  3. c_smithwick

    Code to change form properties

    You must open the form in design view to change any of the properties. Why are you wanting to change the properties at run time? Perhaps you should look at your design scheme. Needing to change a form's properties at run time is unusual.
  4. c_smithwick

    Dynamic Creation of Combo boxes

    The problem with adding combo boxes (and you can do it by opening the form in hidden mode in design view and then saving it) is that you have to programatically position your combos as well as maintain a current count, in case you have too many and need to delete some. Better way would be to...
  5. c_smithwick

    Error 9 Subscript Out Of Range when copying records from form (datasheet) to Excel

    There is an easier way to do this. Use the query (or construct one) that the form is based on and transfer your data directly to a spreadsheet with the TransferSpreadsheet method DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel9, "qryName", "filePath" substituting the name of your...
  6. c_smithwick

    Adding Event Procedures through Code!

    Why not make the function public, put it in a module instead of in each forms class module and simply call it from each forms OnError Event. Then if you have to make changes, you only have to make them in one place.
  7. c_smithwick

    Syntax problem

    Try the following: Private Sub MySub_DataFind(strMy_TblQry As String, strMy_Field As String, strMy_Control As String) Dim rstMy_RecordSet As DAO.Recordset Dim dbMy_DataBase As DAO.Database Dim strMy_test As String Set dbMy_DataBase = CurrentDb Set rstMy_RecordSet =...
  8. c_smithwick

    using IIF inside a Dcount function

    Your criteria statement is not contained within quotes, hence access thinks you are missing an argument, plus you had some misplaced or missing single quotes, plus your Instr was missing the first argument - the starting character: Look at your original below: DCount("*", "[Scheduled...
  9. c_smithwick

    Update all Null Fields to a specific number using VBA

    Need to check to make sure the table is not a system object or hidden object. Add code to test and make sure tdf.Attribute <> dbSystemObject or tdf.Attribute <> dbHiddenObject before attempting to Edit
  10. c_smithwick

    Update all Null Fields to a specific number using VBA

    Try the below mod: Public Sub changeNulls() Dim rst As DAO.Recordset Dim fld As Field Dim tdf As TableDef For Each tdf In CurrentDb.TableDefs Set rst = CurrentDb.OpenRecordset(tdf.Name, dbOpenDynaset) With rst Do While Not .EOF For Each fld In...
  11. c_smithwick

    VB code to display all the 52 weeks in a year

    It is not altogether appropriate on this forum to be asking for someone to do your homework. The purpose of the exercise is to use your noggin' to figure out how to do it, not get someone to show you! Think outside the box, try things, compile it, test it, figure out why it isn't working and...
  12. c_smithwick

    Problems calling a function from a command button

    I think I understand the source of your confusion. Open the Properties window for your command button on your form, go to the Events tab and next to OnClick put =PrintDoc()
  13. c_smithwick

    Copy and Paste Append not appending every field

    Try this instead of your temporary table: Public Sub addRevision(strFilter As String) 'strFilter will be your SQL to filter out your record Dim rstOriginal As DAO.Recordset Dim rstFilter As DAO.Recordset Set rstOriginal = CurrentDb.OpenRecordset("OriginalTableName", dbOpenDynaset) Set...
  14. c_smithwick

    Update all Null Fields to a specific number using VBA

    Try the following: Public Sub changeNulls(strTable As String) Dim rst As DAO.Recordset Dim fld As Field Set rst = CurrentDb.OpenRecordset(strTable, dbOpenDynaset) With rst Do While Not .EOF For Each fld In .Fields If IsNull(fld.Value) Then...
  15. c_smithwick

    DateAdd Update Query

    Substitute the name of your table where appropriate in the below SQL UPDATE {table name here} SET {table name here}.[DueOut] = DateAdd("d",[{table name here}]![WDays],[{table name here}]![DateReceived])
  16. c_smithwick

    Should Abortion be Allowed?

    IMHO the abortion debate boils down to two arguments - a moral/religious one and a legal one. Right now, the legality of abortion in the first trimester of pregnancy is predicated on the medical evidence that strongly implies that a fetus cannot survive outside of the mother until at least the...
  17. c_smithwick

    Reasonable time between updating front ends

    Improvements and additional functionality should be implemented as soon as they are developed and FULLY bug tested. As to bugs, I use line numbers on all my code and keep a duplicate "development" database on my local hard drive. My error handling is set up within my deployed database to send...
  18. c_smithwick

    Query Confusion

    Try two criteria: Date Returned Is Not Null which will give you everything which is in stock combined with Date Issued < Date Returned which will limit the items to those which have not been re-checked out, as I assume new reissues will have a Date Issued greater than the previous Date Returned.
  19. c_smithwick

    VB code to send a form to email

    I don't think you are going to be able to do what you want. Even when you insert a spreadsheet into an outlook message body, the sheet is converted to text or html. If you want to include an access form in the message body, you are going to have to export it or print it to a file and then...
  20. c_smithwick

    Display Problem With Numeric Values

    The trailing zero is not a significant digit, hence when you run the Right function on the data it is dropping the insignificant digits, converting the number to a string and displaying the last two digits stored. The only workaround I can think of for this is to store your values as text.
Back
Top Bottom