Search results

  1. A

    opening reports from Visual Basic

    I know it's easy to use Access tables and queries from a stand-alone compiled Visual Basic application. How about reports (or forms for that matter)? What I want to do is have a stand-alone compiled Visual Basic application that allows the user to open reports (and/or forms) stored in an...
  2. A

    Expression too complex ... (blah blah ... )

    I have a query based on a main table with outer joins to 7 lookup tables - in each case, the join includes all records from the main table and only matching records from the lookup tables. The query grid also includes 4 form-based combo boxes, and for each of those the Show box is unchecked and...
  3. A

    Function to test for existence of record

    In Re: "Unfortunately the data that becomes the primary key has already been created before the information is entered into the database, so I truly do need to ensure that the primary key doesn't exist before the data is entered." I suggest you go with an autonumber key field. You can still...
  4. A

    Error 32811 in Executing a Procedure with VB Code

    If only one user is having this problem, and there are no apparent problems when you repeat the import, I would look at the following: 1. re-importing the entire application (something else may have gotten corrupted besides the module where the error occurs) and/or 2. re-installing Access on...
  5. A

    Want to change table's key field to autonumber

    Add the eight "missing" records to your existing table, using the "missing" numbers in the key field. Then copy the table's structure only to a new table. Then delete the key field from the new table, and add a new autonumber key field to it. Then copy all the records from the old table to...
  6. A

    Clock

    At the beginning, compute and record the desired end time. In the OnTimer event procedure, update your "countdown" clock by computing the time remaining from Now() until the recorded end time. I think you can do it with the DateAdd and TimeValue functions, but you'll have to play with these...
  7. A

    Text Box Control Source with formatting and filtering

    Your problem may be due to your using the Count function (which counts all records in the underlying table or query) rather than the DCount function (which performs a similar operation, but also provides the option to limit the count to records meeting a specific criteria). My guess is that...
  8. A

    Visible Only When Needed

    Unless the number of fields involved gets much larger, a simple way to do it would be to replace your two procedures with one, something like this: Sub SetIt(Setting as Boolean) Dim Opposite as Boolean Opposite = Not Setting 'make these fields visible if Setting = True, 'or invisible otherwise...
  9. A

    Clock

    You can build a clock from a text box. Set the form's Timer Interval property to some positive integer (100 should work well), and use form's On Timer event procedure to update the clock every time the timer fires. You'll probably want a Sub to initialize the clock to 2:00 and store the time...
  10. A

    combo box probs...

    Try using the combo box wizard to construct the combo box, then inspect its properties to see how it's done. If it's updating the wrong table, that's probably because you have it bound to the wrong table.
  11. A

    Code to Enter Value into Disabled/Locked Field on Form

    You can still manipulate a table field in code, regardless of whether a control bound to that field is locked in the user interface.
  12. A

    Passing parameters into Access using VBA

    You can use the /cmd command line argument to pass a text argument to Access on startup, and which will be available while your application is running via the Command() function. If that's not practical, you can put the argument(s) into a simple text file, and have some VBA code in Access read...
  13. A

    progress meter

    Access has a progress meter that you can activate and control via the SysCmd function, but its a bit clunky. I prefer my own solution, embodied in a small form object. The form is intended to be inserted as a subform anywhere you need a progress bar. The bar itself is simply a label control...
  14. A

    combo box to update two fields after update

    List box / combo box columns may be referenced whether or not they are hidden. In most cases, you will want to hide all columns (except the one the user selects a value from) by setting their widths to 0.
  15. A

    Code not working (?) - need help!!!

    Put the code to accomplish all this in the form's BeforeUpdate event procedure, something like this: Private Sub Form_BeforeUpdate(Cancel As Integer) Select Case Prod_Grp Case "EA" If IsNull(Rel_TR) Then Cancel = True Rel_TR.SetFocus Exit Sub...
  16. A

    Auto Text Box Entry after Move to New Record

    You can probably do all of this in the form's BeforeUpdate event procedure. First, check that all required entries have been made - if not, display a message box and set the Cancel argument to True to cancel the update (and the move to another new record). If the required entries have been...
  17. A

    Passing parameters into Access using VBA

    What object are you trying to pass parameters to, and in what context?
  18. A

    Copying to clipboard...

    It seems that Access does not directly support clipboard operations (without explicitly linking in an additional DLL). So, I have fallen back on the funky SendKeys approach. I use the following code, and it works fine on a locked field: txtText.SetFocus txtText.SelStart = 0 txtText.SelLength =...
  19. A

    Printing error messages

    Set up a table for your error messages. Where you now have code to display the error message in a MsgBox, replace that with DAO code to open the table, create and add a new record, and close it. If you wish to print one or more error table records, set up a report based on that table, and use...
  20. A

    Make Tabs Visible

    Sorry about that - my mistake. It should be the OnCurrent event (which fires each time a new record is displayed) rather than the OnActivate event (which fires each time the form gets the focus and becomes the active form). If you have a different set of rules to apply (vis-a-vis which tabs...
Back
Top Bottom