Search results

  1. A

    using down/up arrow to move between records in form

    You can set just about any keystroke to perform just about any action. Look at the help screens for the KeyPress event for the details of how to do it.
  2. A

    subform navigation from subsubform

    At management's direction, I've designed a navigation bar to replace the one Access displays when a form's Navigation Buttons property is set to Yes. It has five command buttons and a label to show the current and total records. It's designed to be used as a subform, and its crucial code...
  3. A

    Close a Shelled application

    I don't think this is the best way to do it, but it should work in most cases. You can use the AppActivate statement to switch the focus to the application you previously launched with the Shell statement, and then use the SendKeys statement to send that application an Alt-F4 keystroke, which...
  4. A

    Hidden attributes

    The Attribute property may combine multiple settings. For instance, if the following attributes are defined for the House object: vbSplitLevel = 1 vbOver20YearOld = 2 vbAtLeast4Bedrooms = 4 if a particular house has both a split-level design and 4 bedrooms, its Attribute property would be set...
  5. A

    Losing the focus

    My mistake for not being clearer. A form's OnCurrent event procedure is actually named Form_Current, and since it's declared as private it can only be called from within the form itself, which is why you can't reference it from the pop-up. Try the approach just posted by Pat Hartman.
  6. A

    Need help with DateDiff

    To compute the number of hours instead of the number of days, you'd need to modify the function as follows: 1. make sure that Date1 and Date2 both contain date and time values (e.g., 12/12/01 10:45:32 AM). 2. for each loop iteration except the last one, add 24 to the counter instead of 1. 3...
  7. A

    Losing the focus

    After returning from the popup form, execute: Me.Requery in the subform. That may work by itself - if not, try then explicitly calling the subform's OnCurrent event procedure.
  8. A

    Need help with DateDiff

    Here's an example: Sub TestIt() Dim Date1 As Date, Date2 As Date Date1 = #12/1/01# Date2 = #1/1/02# MsgBox "There are " & Weekdays(Date1, Date2) & " weekdays between " & Date1 & " and " & Date2 & "." End Sub Function Weekdays(StartDate As Date, EndDate As Date) As Long 'returns number of...
  9. A

    How do I copy a table to a another Access database?

    Check the on-line help for the TransferDatabase action and TransferDatabase method. Either of them should do the trick.
  10. A

    Need help with DateDiff

    You can do this with a For - Next loop. The initial value will be the start date + 1, and the terminal value will be the end date. On each iteration of the loop, use the Weekday function to determine if that date falls on a weekend. Add 1 day (or 24 hours) to your elapsed time only if the...
  11. A

    Import using Variable

    Just let the user select any one of the files, strip the three-character code off the selected name, and set up a loop to do the import six times. On each iteration of the loop, append a different three-character code to the stub of the file name and use the resulting name as the source file...
  12. A

    scanning barcode

    "KB wedge" means a keyboard wedge, which is a device connected between your computer and your keyboard, so that the bar coded data appears to the computer as if it had been typed at the keyboard. The other common way of getting the bar coded data into the machine is via the serial port. If...
  13. A

    can't reset combo box

    Rich, Combo2.Undo won't work, because the Undo method must be applied before the object has been updated. However, your suggestion led me to the solution: save to local variables the values of the previous controls on the form, then execute Me.Undo (which resets all the controls on the form...
  14. A

    Explanation Needed - How Code that Recursively Search Works

    I don't completely understand your routine (perhaps because I work in Access 97, which does not seem to include FSO), but I think I can help with a few things. Normally, when a function name appears on the right side of an assignment statement within the function itself, that does result in a...
  15. A

    Saving FileName Do.cmd?

    A simple way to save just a file name (or any other bit of data) to a table, and later retrieve it, would be via DAO. For instance, you could set up a table called SaveData, consisting of only a single Text field called SaveText, and use the following two procedures to (1) clear any existing...
  16. A

    can't reset combo box

    Thanks, bbrendan, but I'm already doing what you suggest, and it doesn't work. While it does requery Combo2's list, it still does not remove the now invalid selection displayed in Combo2's text area. I need to remove that to prevent the user from saving a record with a Combo2 value no longer...
  17. A

    can't reset combo box

    A table consists of four fields, all of which must be included in the key. The AllowZeroLength property for all four fields must remain set to No because of the requirements of the application. On a subform based on this table, two of those fields are bound to combo boxes Combo1 and Combo2...
  18. A

    On error goto ... / on error resume next

    Another approach is simply to use additional On Error statements to change the error handling at each point you need to do so. What I mean is, use separate On Error statements, rather than trying to incorporate them into With statements.
  19. A

    Passing parameters to a report based on a query

    To pass the value of text box Text1 on form Form1 directly into either a select query or a report field, simply include the following expression at the appropriate place in the query or report: Forms!Form1!Text1
  20. A

    Declare Variable

    I'm not sure if this is it, but ... If you're using Access 2000, you'll get an error message when you try to declare a variable of type Database or Recordset, even though such declarations were perfectly legal (in some cases necessary) in Access 97. I got around this "feature" of A2K by simply...
Back
Top Bottom