Results 1 to 4 of 4
  1. #1
    Ayiramala is offline Advanced Beginner
    Windows XP Access 2010 32bit
    Join Date
    Dec 2014
    Location
    Kerala, India
    Posts
    74

    Command Button On Each Row Of A Continuous Form?

    Hi,


    This is what I have done: There is a continuous form with a check box in each row and a command button(cmdDetails) in the form footer section. You select a record and press cmdDetails and another form opens.

    Rather than in the footer, I would like to have the command button placed in the details section itself, in each row, against each record, so that the check box can be eliminated. Pressing any button will open the corresponding form.

    Could some one please help me with this? I have the least idea how I can "associate" each record with the button next to it.

    Thanks.

  2. #2
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2013
    Posts
    7,862
    I don't use continuous forms very often. But, you should be able to do what you want.

    While in Design View of your form, add a Command Button to the detail section. Add some VBA behinf the new control by going to the property sheet. Under the Event tab, click on the elipses(...) to the right of the On Click event. Click on Code Builder and then click OK.


    The VBA editor will open. There will be a new sub procedure created for the click event. Just above the line that says End Sub place your VBA. Here is an example. You will need to change the FormName, FieldName, and Control Name to match your DB

    DoCmd.OpenForm "FormName", , , "FieldName = " & Me.[ControlName]

  3. #3
    Ayiramala is offline Advanced Beginner
    Windows XP Access 2010 32bit
    Join Date
    Dec 2014
    Location
    Kerala, India
    Posts
    74
    That worked! Thank you very much. May I ask just one more thing?

    Depending on whether frmDetails is empty or not, can we apply some conditional formatting to the command button? For example, if frmDetails is empty, the button is blue, otherwise it is red?

    Again, thank you very much for your help.

  4. #4
    Ayiramala is offline Advanced Beginner
    Windows XP Access 2010 32bit
    Join Date
    Dec 2014
    Location
    Kerala, India
    Posts
    74
    Kindly ignore the previous post.. Learned how to do it with a text box instead.

    Thanks for all the help. Much appreciated.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 4
    Last Post: 11-21-2014, 09:56 PM
  2. Replies: 3
    Last Post: 09-23-2013, 06:42 AM
  3. Continuous Form Button
    By swalsh84 in forum Forms
    Replies: 2
    Last Post: 07-12-2012, 12:13 PM
  4. Continuous Form Disable Command Button
    By mbake085 in forum Programming
    Replies: 4
    Last Post: 05-27-2011, 08:55 AM
  5. Replies: 1
    Last Post: 07-27-2010, 02:27 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums