Search results

  1. M

    Continue Statement

    Is there a way to get the effects of a "Continue" statement in a Do...Loop? I want to stop the loop at a point if a particular item is not found and continue the loop from the top...the next iteration of the loop. Do we have anything like that? Thanks, Mike
  2. M

    Changing Subform Recordsource Dynamically

    OK, That worked. Now I get an error stating that I canceled the previous operation. I did not do that! I get this doing a DLookup ME
  3. M

    Changing Subform Recordsource Dynamically

    OK, Do I do that within the variable, i.e. build the variable string to include the brackets? Or just surround the variable name within the sql string with brackets? I may look at a way to remove the spaces. It is all created dynamically...so it will not be easy. Thanks, Mike
  4. M

    Changing Subform Recordsource Dynamically

    OK, When I remove the single quotes in the SQL string, I get the following error: Syntax error (missing operator) in query expression 'Air Movement Control Officer.fldClassNum'. This is what the selRec variable evaluates to based on users selection. So how can I format the sql string to work...
  5. M

    Changing Subform Recordsource Dynamically

    Hello, I have a main form with two subforms. The second subform is not visible until the user clicks on a row within the first subform. Upon the second subform becoming visible on the main form, I would like to set the second subform's recordsource via code based on what the user has selected...
  6. M

    Record Navigation

    Hi, How can I iterate over all the records in a table and get each value from a field in each record? I want to get each value from the field, do something to it, then add it to a combobox. Is there a way to do this simply? v/r Mike
  7. M

    Data Write

    When I do the write, as follows: DoCmd.GoToRecord acDataForm, "frmMain", acNewRec sqlText = "INSERT INTO tblmain (controlnum) VALUES ('" & tskNum & "');" DoCmd.RunSQL sqlText This works fine but then I do this: strRecord = "SELECT * FROM tblmain WHERE controlnum = '" & tskNum & "'"...
  8. M

    Data Write

    When does form data get written to a table? I want to use the value from a textbox as openargs for another form. If I don't do a write to the table with SQL, then I get a NULL error on the getOpenArgs on the form. If I do do a write, then I get multiple occurrances of the record. Thanks, Mike
  9. M

    Dynamic Arrays

    That worked....cobwebs are coming off. Thanks, Mike
  10. M

    Dynamic Arrays

    Hi, How can I determine the length (size) of a dynamic array so I can iterate over it? Thanks, Mike
  11. M

    Saving Lists

    Hello, I have a main form where the user can click on a button that opens another form. In this form, the user can make selections from one listbox and they are copied to another listbox. How can I save the contents of the listbox into a field that is part of the record on the main form...
  12. M

    SQL INSERT INTO....error message

    jeremy, The tblName is the first variable in the statement...that is coming out fine in the debug. Adding the ; at the end inside the ending " did nothing. Outside the ending " gave an error in the code window. So that is not the problem. Mike
  13. M

    SQL INSERT INTO....error message

    Hi, I am trying to make the code shown below work....and I get the error message: Syntax error in query. Incomplete query clause. Here is the code...I cannot figure out why it won't work. Any ideas? Dim cpyText As String Dim sql As String Dim newName As String cpyText = List11.Column(0...
  14. M

    List Data

    I have a listbox on a form that is populated from a table. I want to be able to select from that list box and populate another listbox. I can do this with code right now, what I cannot do is get the data added to the blank listbox to be saved in a table. I have bound the listbox to a memo field...
  15. M

    List Boxes

    Wayne, I bound the listbox to the memo field. The listbox acts correctly on the form. However, items that are added to the list box are not being saved to the memo field in the table. It remains blank. How do I capture the listbox text to the memo field in the table? Mike
  16. M

    List Boxes

    If this cannot be done, can I add new line characters to text strings as they are entered into a multiline text box to achieve the same results?
  17. M

    List Boxes

    If I use a list box on a form how can I associate that listbox to a memo field in a table? Can I do this? I am doing it in VB and all works but the text that is added to the list box does not save to the memo field in the table. I want to be able to select items from one list box and copy them...
  18. M

    Updating Form Data

    That worked...Thanks
  19. M

    Updating Form Data

    Hello, I have a form that is just for viewing data from tables. I have two other forms that edit that data. They are opened with click events from the original form. How do I have the main form update the data when I close an edit form? It will work "out of the box" if I am editing data. But...
  20. M

    Reading Field Data into Variable

    OK, I switched up to a ComboBox.... Here is code snippet: sel = Combo30.Text tmpStr = DLookup("[rank]", "tbl_user", "[lname] = " & sel) It gets the selected ComboBox text and reads it into the variable sel Then I want to use DLookup to read the value of the "rank" field from the "tbl_user"...
Back
Top Bottom