Results 1 to 4 of 4
  1. #1
    Join Date
    Jan 2004
    Posts
    2

    Unanswered: How to tell if a record is selected in a form?

    Hi-

    I was wondering if this is possible and if anyone knows how to do it.

    I have a continuous form. When I select a record (using the record selectors on the side) and click a cmd button, it opens to a new form that has additional information about the currently selected record.

    What I would like to be able to do is disable the cmd button and then, once a record has been selected, enable it. This is just to ensure that the user actually selects the record like the directions (that no one seems to want to read) tell them to do so, before clicking the cmd button to get more details.

    If anyone can help, it would be much appreciated!

    Thanks.

    btw- I am using Access 2000 and my continuous form is a subform on a main form.
    Last edited by mazzola; 01-16-04 at 13:22.

  2. #2
    Join Date
    Sep 2003
    Location
    MI
    Posts
    3,713

    Re: How to tell if a record is selected in a form?

    Originally posted by mazzola
    Hi-

    I was wondering if this is possible and if anyone knows how to do it.

    I have a continuous form. When I select a record (using the record selectors on the side) and click a cmd button, it opens to a new form that has additional information about the currently selected record.

    What I would like to be able to do is disable the cmd button and then, once a record has been selected, enable it. This is just to ensure that the user actually selects the record like the directions (that no one seems to want to read) tell them to do so, before clicking the cmd button to get more details.

    If anyone can help, it would be much appreciated!

    Thanks.

    btw- I am using Access 2000 and my continuous form is a subform on a main form.
    By definition, (with continuous forms especially) if there are records in the underlying table, the continuous forms form is on record #1 by default. The only way for this not to happen is to perform a "reload" of the table and not perform a ReQuery ... As for disbling the cmd button, if the table is empty then disable the button otherwise leave it enabled because at worst you are on Record # 1.

  3. #3
    Join Date
    Jan 2004
    Posts
    2
    I am not sure that I understand exactly what you are saying... but I don't care which record they select, I just care that a record is selected. In otherwords, if there was an event or a property that I could reference... something where I could say, If record = selected, Then cmd.enabled = true.

    Furthermore, right now, if they click the cmd button to access more details and at least 2 of the fields do not have data in them, an error msg will pop up.

  4. #4
    Join Date
    Sep 2003
    Location
    MI
    Posts
    3,713
    Originally posted by mazzola
    I am not sure that I understand exactly what you are saying... but I don't care which record they select, I just care that a record is selected. In otherwords, if there was an event or a property that I could reference... something where I could say, If record = selected, Then cmd.enabled = true.

    Furthermore, right now, if they click the cmd button to access more details and at least 2 of the fields do not have data in them, an error msg will pop up.
    Why not test the MySubForm.CurrentRecord for a value >=1? What is the importance of the last bit regarding 2 empty fields???

Posting Permissions

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