Search results

  1. G

    VBA - create SQL statement using selections from Listbox as parameters

    Hi all, I'm using MS Access 2007. I am trying to create a SQL statement 'on the fly' in VBA to gather user information to populate a template which is created using an Excel Template. The SQL statement queries a table to extract 3 fields. Field 1 populates a combobox on my form and 1 item is...
  2. G

    Subform unbound textbox value not updating on main form open

    Hi, I have a subform which is linked to a table on which I have a set of comboboxes and textboxes. When data in the comboboxes is chosen, the textboxes populate with numbers and the underlying table is populated. I also have an unbound textbox which calculates using a function the sum of the...
  3. G

    Form combo dropdown

    Hi all, I'm wondering if the following logic should work. I don't want to waste too much time on it, if it's an impossibility. Your opinion would be much appreciated. I have a form on which I have 2 combo boxes. I want the 2nd combo box to filter it's list depending on the value in the 1st...
  4. G

    Form Controls - dynamically creating

    Hi all, I have a form which I want to contain a list of people's names and for each person there are a set of textboxes which link to a querys in the background to show a drop down list. On form load a query triggers to give me the current list of people and only that number of controls...
  5. G

    In cell List box to return adjacent value

    Hi all, I'm creating an input sheet for a friend using Excel to simplify the collection of data. I have a list box set up in a set of cells which contains a listing of codes. What my friend wants is for the inputter to be able to choose one of these codes, but for the return value in that cell...
  6. G

    Worksheet Change Events

    I have 3 events that need to work when certain cells are changed. The first 2 events are identical, but are set up to look at different ranges of cells within the same Excel worksheet. Each one works fine on its own, but won't work together. So I put 1 in the Worksheet change section and the...
  7. G

    Excel VBA Worksheet Change function - more than 1 function

    Hi all, Thanks to Craig Ottley and Batman in the Ozgrid Forum I have been able to set up functions in Worksheet_Change(). My problem is that each function will work correctly on their own, but when I try to put 2 functions together, I can't get them to work independently. Is this possible? '...
  8. G

    MS Access vba password problem

    Hi all, I am using a database that was created years ago, which has the vba password protected. I don't know the password and would like to make some changes to the design of the reports that are output. Can anyone help? rgs Ginny
  9. G

    Problem with .AddItem to Listbox

    I want to populate a listbox with the data in column B dynamically. So I am adding the following code in the userform initialisation. It stops at the .AddItem cellValue line. My listbox value is appearing as nothing. Dim r As Long Dim RequiredRosterDWSText As MSForms.ListBox Dim...
  10. G

    Add dynamic textboxes to userform

    Hi all, I'm using VBA in Excel with a userform which initialises with textboxes. The number of textboxes that are created are dependent on the number of records in a worksheet and each textbox is populated with the data in the cells. This works perfectly, what I want to have happen is a...
  11. G

    VBA - Change Directory

    Hi all, I would appreciate help with above. I have coding as follows: ChDir _ "Z:\SAP_HR\Ginnys_Folder\" as part of an Open File sub routine. My directory will never change although the file to open will have a different name each time. Here's my problem. The above works...
  12. G

    List Box output on Report not formatted as expected

    Hi all, I have a database which is used independently in a number of sites. Different versions of MSAccess are available in these sites. Here’s my problem. The underlying tables have number fields formatted as double. There are queries which use operators to multiply and divide which...
  13. G

    multiple query protection

    I have quite a number of queries in my database, where one query is based upon the results of another. Is there anyway I can protect my dependent query or issue a warning if I make a change which impacts on my base query? Regards, Ginny :confused:
  14. G

    No of Sundays in a period

    I want to find the number of Sundays in a period. I am asking the inputter to give me the start date of a period and the end date. Can someone suggest coding to iterate through the dates and count the weekday index 7 only. I'm getting bogged down in this. Help appreciated. rgs Ginny
  15. G

    Custom menu

    I have built a custom toolbar. 2 things I am having a problem with. Can I make the toolbar only available in a specific workbook. Secondly, I have a list of items which will change from time to time on a worksheet. Is it possible to have these linked to the menu as the captions on the menu...
  16. G

    Adding Data from Excel to Access Table

    Hi I have the following Sub Routine which exports data from an Excel Worksheet into an Access Table. This works perfectly if the table contains no data, but errors if it does. Is there anything I can add to this to allow the data to be appended to the table. Sub...
  17. G

    Date Conversion

    Hi I’m importing a date which is in the format dd.mm.yyyy. I need this field as a date in my database. The following works in a Query: LEFT(Import_Table.F6],2)+"/"+MID([Import_Table.F6],4,2)+"/"+RIGHT([Import_Table.F6],4) When I transfer this to VBA Code though, it doesn’t work. Dim sql...
  18. G

    Appending to Table using table Variable name

    Hi all, I hope someone can help me!! I want to import data on a monthly basis into tables, but I want to be able to use the same import buttons each month and pass the data into the relevant monthly table. My Steps - Set Reporting Month variable (which sets the Table name Variable), choose...
  19. G

    Setting the Year Variable

    I don't know if this possible, but would love some help on this. I am building a Trend of data on a month by month basis for the year. I have built queries which gives me the data I want in the format I want, but I have a problem. I now want to use the same Trend for every year without...
  20. G

    Adding picture to automatic email from Excel

    Hi all, I am using the following code to send out automatic emails containing some text in the body of the email plus an attachment and this works perfectly: TempFilePath = Environ$("temp") & "\" TempFileName = "Selection of " & wb.Name & " " & Format(Now, "dd-mmm-yy h-mm-ss")...
Top Bottom