Results 1 to 2 of 2
  1. #1
    Join Date
    Sep 2003
    Posts
    2

    Question Unanswered: highlight record on form and show record and details on another form

    Hi,

    I'm new to VBA programming and learning.

    I'm trying to design a form that opens up when a user selects an entry from a switchboard. This form should display records from a query in continuous form format. I want to include check boxes (or radio buttons) next to each record and when the user checks a check box (or radio button) next to a particlar record the entire record (6 fields) should be highlighted (in some color, ex. yellow). There is a command button on this form and when the user clicks this command button a new form with a sub form should open and the highlighted record should be displayed in the main form at the top, and the details (based on a particular field in the record) should be displayed on the sub form.

    Any help is greatly appreciated.

    JS

  2. #2
    Join Date
    Dec 2002
    Location
    Préverenges, Switzerland
    Posts
    3,740
    unfortunately you cannot do it the way you propose: unbound radio buttons or checkboxes on continuous forms are on or off for all records. click one, and they all change.

    the simplest route around this is to give your continuous forms a header (or footer) and repeat the fields there. when the user clicks a record in the continuous form detail, the current record data will be displayed in the header (footer).

    using the ID from the header (footer) you open your new form at the appropriate record using arguments:

    private sub theButton_Click()
    dim strLinkCriteria as string
    strLinkCriteria = "[nameOfIDfield]=" & Me![nameOfIDfield]
    docmd.openform "nameOfTheOtherForm", , , strLinkCriteria

    (replace theButton, nameOfIDfield, nameOfTheOtherForm with the real names, of course)

    izy

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •