Search results

  1. S

    Edit vba macro to paste data into specified worksheets

    Hi, I am not sure if this will solve the problem, but you have set the object type for xlapp, xlbook and xlsheet to an excel application. Firstly you will need to set up these objects properly. dim xlapp as Excel.Application dim xlbook as Excel.Workbook dim xlsheet as Excel.Worksheet dim...
  2. S

    directory creating based on form values, filecopy

    That's my pleasure, glad you got it working. Not sure about closing a thread though!
  3. S

    temporary tables and mysql

    Hi, Have you installed the ODBC driver for MySQL, if not I would suggest you do that first. The ODBC driver is called MyODBC I would then use ADO to connect to the MySQL database using this as the connection string, assuming the MySQL database is stored on the local machine Dim cn As...
  4. S

    directory creating based on form values, filecopy

    You are correct, you need to build the directories level by level if they do not exist. Rather than starting from scratch I suggest you use the function written by Chip Pearson on his site here: http://www.cpearson.com/Excel/MakeDirMulti.aspx Copy the code from his site into your module, and...
  5. S

    directory creating based on form values, filecopy

    That is because you need to reference a file called scrrun.dll to get this to work. Follow these instructions: 1) Press ALT+F11 to open the visual basic editor 2) Go to the Tools Menu and select References 3) Scroll down the list and check the box next to "Microsoft Scripting Runtime"...
  6. S

    need help pleaseeeeeeeeeeeeeeeeee

    Hi, What version of Access are you using? I am unable to open the database using Access 2007.
  7. S

    Loop for counting Dates

    I was thinking that if you get the list of dates from a table that you will need to manually change these dates each time you want to display the data. Does that make sense?
  8. S

    Loop for counting Dates

    In addition to pbaldy's reply, you could get the list of dates from a query instead of a separate table: Query 1: SELECT tblDates.DateField FROM tblSetInfo GROUP BY tblDates.DateField; Query 2: SELECT Query1.DateField, (SELECT Count(*) FROM tblReservations WHERE StartDate <= DateField AND...
  9. S

    directory creating based on form values, filecopy

    Hi, 1) Ok, you can get the new file path like this: strNewFilePath = strPath & "renamed_filena me1.ext" 2) To copy instead of move use the following: set fi = fso.GetFile(strOldFilePath) fi.Copy strNewFilePath 3) I used the For loop to simplify the code a bit. You can just do this long-hand...
  10. S

    directory creating based on form values, filecopy

    Hi, If you are trying to manipulate files and directories it is well worth learning to use the FileSystemObject. This will allow you to create, rename, copy, move and delete both files and folders. You will first need to set a reference to the Scripting Runtime library. From the visual basic...
  11. S

    trying to create a custom shortcut

    Hi, I have little experience of this but can give you some pointers. Firstly you need to create a reference to the Microsoft Office Library. In the Visual Basic Editor go to Tools > References and check the "Microsoft Office x.0 Object Library" If you are trying to add a new commandbar I'm...
  12. S

    A-Z Listing Form

    Hi, There are lots of ways that you could achieve this. This is just one possible example. Let's say you have a table called tblNames with a list of people's names, and you want to be able to display all the names beginning with each letter. The field in the table in this example is called...
  13. S

    How to make a textbox that is automatically filled based on two selected combo boxes?

    This code will perform a lookup to find the value when either ComboBoxA or ComboBoxB is updated. You will need to update the table, field and control names that are highlighted in red. Sub UpdateTextBox() Me!TextBox = Nz(DLookup("PN", "TableName", "PN=" & Me!ComboBoxA & " AND PD=" &...
  14. S

    Write Conflict when upgrade to Access 2010

    Hi, I'm afraid I'm no expert as I use Access 2007. Have you tried creating a new database in Access 2010 and importing all the objects from the old database?
  15. S

    Read Com 4

    It's worth taking a look at this URL to learn about serial port communication using Access: http://www.granite.ab.ca/access/serialport.htm I have used the serial interface in Access in the past, but too long ago to remember enough to instruct you sadly.
  16. S

    Append record if exist or Update if not exist

    OK here is some sample code, although I haven't had time to test it. You will need to go through and enter the names of the actual objects - tables, queries and fields. The code below will pass a parameter called "FieldID" to the query. You can use this to restrict the update query to the...
  17. S

    Append record if exist or Update if not exist

    First of all I would suggest you create the append and update queries that would save the common data into the other two tables. You will probably need to include a parameter for the record ID that you wish to append/update. Then the vba code can use the dcount function to test if the record...
  18. S

    check field and do a replace

    Hi, Your code is storing the altered barcode in a variable, and does not amend the actual field. Try: Me!Barcode = Replace(Me!Barcode, " ", "1")
  19. S

    Fill List box from combo box value

    No worries. Another piece of useful advice is to link tables using a numerical field rather than text. In your case it is much better to use "Customer ID" than "Customer Name". In this case you will have one customer ID (autonumber), and many dongles with their associated Customer ID (number...
  20. S

    Fill List box from combo box value

    Hi, The issue is with the customer combobox - you have used the customer ID as the bound field. This means that when the query checks the value of this combobox it get's the customer's number, and not their name. You have two choices: 1 - change the bound column of cmbCustomer to 2 2 - add the...
Back
Top Bottom