Recent content by sparks80

  1. S

    Changing Printers in VBA

    Hi, Allen Browne has written a very neat utility to allow users to select a printer - I know this is not what you want to do, but the code might give you some useful pointers. http://allenbrowne.com/AppPrintMgt.html I think this is how you set the printer variable: Set prt =...
  2. S

    Dropdown to select employee

    Hi, I'm really glad I could help. Here is some more information that might help. You have set up the table correctly with an Autonumber primary key called EmpID. This field is very useful because of several things: - it can be used as a unique ID for each employee in the database. To ensure...
  3. S

    Dropdown to select employee

    Hi, Firstly I suggest you use the primary key of the table (EmpID) to search for new records, rather than the "Employee Name" field, which is a string. One problem is that you have a combobox with a default name like "Combo18", but you refer to it in the code as "cboName". The next problem is...
  4. S

    Run time error in multiple criteria DLookup

    Hi, The AND part of the statement ended up outside the string, try this: Me.PALLET_QUANTITY = DLookup("[PALLET QTY]", "tblSupplierPalletQty", "[STOCK CODE]='" & Forms![ENTER PURCHASE ORDER]![PRODUCT CODE] & "' And [SUPPLIER]='" & Forms![ENTER PURCHASE ORDER]![ACC NO] & "'")
  5. S

    Help plz, Can't get combo box to find record/populate

    Hi, Beat to it! Bob on an unrelated note I just wanted to say thank you for the "FRONT-END AUTO-UPDATE ENABLING TOOL" on your web site - I have recently used it for a multi-user database and it was a god-send.
  6. S

    Help plz, Can't get combo box to find record/populate

    Sorry, that is partially my fault - I didn't realise that the recordset that needed updating was on a subform. I'll take a look and get back to you
  7. S

    Help plz, Can't get combo box to find record/populate

    Hi, You can use the findfirst method of a DAO recordset to find the record you want like this: Private Sub YourComboboxName_AfterUpdate() Dim rs As DAO.Recordset Set rs = YourFormName.RecordsetClone rs.Findfirst ("YourDateFieldName=#" & YourDateComboBoxName.Value & _ "#...
  8. S

    Run time error in multiple criteria DLookup

    Hi, Try putting single quotation marks around the text string you are entering for the supplier like this: Me.PALLET_QUANTITY = DLookup("[PALLET QTY]", "tblSupplierPalletQty", "[STOCK CODE]=" & Forms![ENTER PURCHASE ORDER]![PRODUCT CODE] & " And [SUPPLIER]='" & Forms![ENTER PURCHASE...
  9. S

    Action queries vs looping through recordsets?

    Hi Spenzer, Quoting the legendary Pat Hartman on this very forum: Also it is worth looking at this URL from the Microsoft Knowledgebase: http://support.microsoft.com/kb/165823 You can compensate for the increase in database size by regularly compacting, but this is one way to avoid it in...
  10. S

    Select Query to Update

    Hi, can you possibly give me an example URL that you are trying to generate, and which parts of the URL are made up by the fields in the query (as well as the field names). Then I can show you how to concatenate the results to give the URL. Thanks, Mark
  11. S

    Action queries vs looping through recordsets?

    Hi, One of the things I have learnt on this forum is that it is often preferable to create a saved query and pass any necessary parameters, rather than constructing the SQL statement in code. Apparently the latter method is one of the factors that causes significant bloat in databases. So...
  12. S

    complex schedule / appointment book

    Hi, I agree with VilaRestal, the demo provided will be more flexible than my suggestion. The problem is that unless you are familiar with VBA, I think putting together the code to make it do exactly what you want will be quite hard. For information, the last time I checked, the maximum number...
  13. S

    How to combine these tabkles?

    Hi, I have tried to explain the query by using a Venn diagram - see the attached image! The query is made of three parts like this: Part 1 Retrieve records where fields C, D and E exist and match in Table 1 and Table 2 Part 2 Retrieve records where fields C, D and E exist in Table 1, but not...
  14. S

    complex schedule / appointment book

    Hi, If you could upload a sample of the database that would be very helpful. You can remove most of the data (all if it is confidential). To reduce the file size you could try compacting the database, and zipping the resulting file. I think given the complexity of what you are trying to do...
  15. S

    Can VBA open a txt file?

    Hi, Further to the previous suggestions it is possible to use VBA to read the content of a text file and display it in the database without opening an external file. This example will read a text-file and display the results in a message box. This requires adding a reference called "Microsoft...
Top Bottom