Search results

  1. E

    Alphabet loop

    Hello, I'd like to create a loop that will step through the letters of the alphabet, or part of it, in sequence. My first thought was to create a 1-D array called alpabet containing the letters then use: For Each letter In alphabet ..... Next I'm just wondering if anyone has thoughts on any...
  2. E

    Toggle button to select all list items

    Hi, I am trying to create a toggle button that will select/de-select all items in a list box. At the moment I have: Private Sub selectall_Click() Select Case selectall.Value Case Yes {code to select all} Case No {code to de-select all} End select End Sub The question is, can anyone tell me...
  3. E

    Opening a recordset based on an SQL statement

    Hi I am trying to open a recordset based on a query, but using an SQL statement to only retrieve certain records. I am using VBA to create a string with the criteria from a list box. When the code runs, the recordset contains all the records from the "parts" query instead of just the selected...
  4. E

    Reference a field by its ordinal number

    Hi, I'm trying to set the values of all the fields in a recordset, and would like to reference each field by number rather than name, so I can create a loop to cycle through all fields eg: Dim rstpiklst As Recordset Set dbs = CurrentDb Set rst = dbs.OpenRecordset("MyTable", dbOpenDynaset)...
  5. E

    Can control positions be returned in VBA?

    Hi, I'm trying to return the position of a label on a form using VBA. I know the top and left properties can be used to set the position, but is there any way of returning the position? What I want to do is find the position of a label then increment it by a set value after an event. Any help...
  6. E

    URGENT! VBA and queries

    Hi, I have part of my code that looks like this: oldstkdate = DMin("date", "qrygdsout") oldstkarea = DLookup("[areaID]", "qrygdsout", "[date] = #" & qrygdsout & "#") Where qrygdsout is a query with two citeria based on the values text boxes in the current form. Now, when I run the code it...
  7. E

    Dlookup problems (string criteria)

    After some playing around further to my question below I have found the problem seems to be that I'm using a string variable as the criteria for the Dlookup function. I assume its a matter of syntax, but how do I use a string variable as criteria in a Dlookup function? Thanks, Paul
  8. E

    how to set focus without highlighting text

    Hi, Is it possible to set the focus to a text box without highlighting the text already there? I have a text box which has a default value, and I set the focus to this when a new record is entered. I want users to be able to just type the rest of the field value, with the first part being the...
  9. E

    Dlookup problems

    Hi, I have a simple, unbound form which has a combo box containing manufacturers, and a text box which I want to display the relevant country when a user selects a manufacturer. I have tried the following code in the combo box's afterupdate event: Dim c As String c = DLookup("[Country]"...
  10. E

    Decimal places for a calculated report control.

    Hi, I have a calculated textbox in a report footer and am trying to get it to display its value to 2 decimal places. I have set the properties-format-demical place of the text box to 2, but I still get loads of decimal places on my report. Why? Thanks in advance for any help, Paul.
  11. E

    Stop hyperlinks opening up a new IE window.

    Hello, I have a form in my database that has a hyperlink field. When I click the hyperlink Internet Explorer opens up at the relevant site. However if I go back to Access, then to a new record and click the new hyperlink a new IE window opens up. Is there a way to make hyperlinks all open up in...
  12. E

    'Refreshing' the contents of a combo box list

    Hi, I'm not sure if I'll be able to explain this problem clearly, but here goes anyway. I have a combo box in a form, and the combo box has a lookup row source like "Select DISTINCT [fieldX] From [tableY]". I have a button on the form to bring up a popup form to add a new record to tableY. The...
  13. E

    Producing a report via a custom dialog box

    Im having difficulty in using check boxes in a custom dialog box, to set up the parameters in a query. I then want to produce a report from this query. Can this be done, and if so does anybody have any advice?
  14. E

    Why won't my popup popup any more?

    I have created a database with a form which has a button to bring up a popup form. In an earlier version of the database this worked fine. Now I have made a few changes and I get an error message saying the table (on which the popup is based) is open through the user interface, and cannot be...
Back
Top Bottom