Search results

  1. A

    adding value from one form to another

    Use the combo box wizard to set up a combo box. The combo box will get its values from a table, query or SQL statement that includes both the contact and company fields (you seem to be storing this same data in 2 tables, which is generally very bad practice, but that's a separate issue). The...
  2. A

    Can't find matching fields

    Check to be sure that you didn't change an exclamation point to a period. If you refer to [Forms]![MyForm]![Item] Access assumes that Item is a control on the form MyForm, but if you refer to [Forms]![MyForm].[Item] Access assumes that Item is a method or property of MyForm, which might...
  3. A

    Need to close form, but unload event causing problems!

    The simple way to use the MsgBox function is to call it as you would call a Sub, i.e., simply specify it on a line by itself, along with any arguments, e.g.: MsgBox "Some message." However, if you want to specify more than the first argument (the message to be displayed in the message box)...
  4. A

    Need to close form, but unload event causing problems!

    I see a couple of problems with this code. First, you are using a series of If...Then/End If blocks, rather than a single If...Then/ElseIf/ElseIf/End If block. If any condition is true, there's no point in checking the subsequent ones. Also, the help screens (at least in Access 97) say that...
  5. A

    Need to close form, but unload event causing problems!

    Assuming you are cancelling the BeforeUpdate event if required fields aren't filled in, when the user attempts to close the form (and the current record has missing field values), they will get a dialog box saying "You can't save the record at this time." and asking them whether they want to...
  6. A

    Can't find matching fields

    Assuming that the relevant control is named txtIDNumber on both forms, in the BeforeUpdate event procedure for the Table B form, put the following code: If IsNull(Me!txtIDNumber) Then Me!txtIDNumber = [Forms]![Table A Form]![txtIDNumber] End If
  7. A

    Calling SubProcedure

    Use the Run method of the Application object to launch the procedure. The Run method takes a string argument containing the name of the procedure to be executed.
  8. A

    Loading DAO at run time....

    It sounds like the second database may not have a reference to the DAO library. Ordinarily, you can just use DAO objects in your code as long as that reference is set. In the second database, open any code module, then select Tools, References, and make sure the correct DAO library is checked.
  9. A

    Need to close form, but unload event causing problems!

    Try using the BeforeUpdate event to verify that the required fields are filled in, instead of the Unload event. That way, if the user opens the form and changes his/her mind before entering or changing any controls, when they close the form the BeforeUpdate event will not fire. If they do...
  10. A

    adding value from one form to another

    To automatically open Form2 from Form1, use the following code: DoCmd.OpenForm "Form2" To set the value of a control on Form2 to the same value as a control on Form1, from code running on Form1, use this code: [Forms]![Form2]![some control] = Me![some other control]
  11. A

    delete confirmation mysteriously disappeared

    I finally figured out what was happening - part of the problem is less than complete documentation of event dependencies in the Access help screens. According to the Access help screens, when you delete a record on a form, the following events fire in this order: Delete, BeforeDelConfirm...
  12. A

    delete confirmation mysteriously disappeared

    Rich: Yes I have, but the result is the same.
  13. A

    auto updating form values based on another table

    Set up a query based on the Individual table joined to the Group table (I'm assuming that Group:Individual is a one-to-many relationship, i.e., each group may have zero, one or more individuals but each individual may belong to only one group). The query's output columns must include at least...
  14. A

    delete confirmation mysteriously disappeared

    In my Access 97 application, the normal deletion confirmation message ("You are about to delete ...") no longer appears when I delete a record using a particular form bound to a particular table. Since there is now no deletion confirmation message displayed, the AfterDelConfirm event procedure...
  15. A

    What's the problem?

    For reasons that are not clear to me, Access does not seem to view the form displayed in a subform control as actually being open, even though it is open from the user's perspective. Try referencing controls on the subform like this: [main form name]![name of subform control on main...
  16. A

    If Not IsLoaded?

    From the Access 97 help system: The IsLoaded function is a sample Function procedure included with the Northwind sample database, and not a built-in Visual Basic for Applications function. To use the IsLoaded function in your database, first open the Northwind sample database, then copy the...
  17. A

    List box problem

    I'm not sure what you're trying to do here. You're opening a recordset and then not using it, and you are repeatedly requerying the same listbox. Why not simply establish the values you need for the SQL statement, then set the listbox RowSource property ONCE, then requery it ONCE? You don't...
  18. A

    Export table to Excel

    Check the help system for the TransferSpreadsheet method and TransferSpreadsheet action.
  19. A

    Do...Loop

    I'm not sure why the Do While statement would only consider the first condition, but that might be corrected by enclosing both conditions in parentheses: Do While (rstRecon("Period") <> Me!Period) And (rstRecon("Year") <> Me!Year) However, you could dispense with the loop entirely by using the...
  20. A

    Invalid operaton while appending field property

    Thank you, Alex! It worked perfectly. I hadn't realized that the tabledef had to be appended to the tabledefs collection before you can append properties to its fields.
Back
Top Bottom