Results 1 to 7 of 7
  1. #1
    Silver Lounger GARYPSWANSON's Avatar
    Join Date
    Aug 2001
    Location
    Frederick, Maryland, USA
    Posts
    1,788
    Thanks
    0
    Thanked 2 Times in 2 Posts

    acCmdFind (A2K SR1)

    A form is designed with a subform. The form and subform are linked with the form being the parent and subform child. The form has a textbox named Clin. The subform details other data associated with Clin.

    I want to add a Find or Search on Clin of the parent form using acCmdFind. I am saving the db as an mde file and the original find process using sendkeys does not work. How do you do this? I have tried but can't seem to get the focus to the Clin textbox.
    Regards,

    Gary
    (It's been a while!)

  2. #2
    Super Moderator
    Join Date
    Aug 2001
    Location
    Evergreen, CO, USA
    Posts
    6,623
    Thanks
    3
    Thanked 60 Times in 60 Posts

    Re: acCmdFind (A2K SR1)

    Tell us about the table structure behind the form and subform - specifically what the relationship between the form table and the subform table is. Usually you have a one to many relationship where subforms are involved, but your post seems to suggest that you may have a one to one.
    Wendell

  3. #3
    Silver Lounger GARYPSWANSON's Avatar
    Join Date
    Aug 2001
    Location
    Frederick, Maryland, USA
    Posts
    1,788
    Thanks
    0
    Thanked 2 Times in 2 Posts

    Re: acCmdFind (A2K SR1)

    There is actually a one to many relationship.

    The Parent Form is based on a table that stores only what I call Clin Master Data. That is Clin, Slin, Description, CPR ID, and Program. The subform that I am using in this case stores all of the funding data changes such as Mod Number, Date, Acrn, Funded Amount and other data for each Clin and Slin. The link between the Parent and Child Form is on Clin and Slin. When the user selects a Clin and Slin in the parent form, all associated funding records in the subform for displayed. (The table relationship behind the scenes is a one to many, that is each Clin, Slin can have many funding modifications.)

    Basically what has happened is that on the top of the form was a command button for "Find Record" that used the sendkeys capability to launch the search feature. The db is now being saved as a .mde and this feature stopped working. I am trying to restore this functionality in the mde. Can you do this with the acCmdFind feature or is there a way to mimic the Ctrl F functionality in the .mde?
    Regards,

    Gary
    (It's been a while!)

  4. #4
    Super Moderator
    Join Date
    Aug 2001
    Location
    Evergreen, CO, USA
    Posts
    6,623
    Thanks
    3
    Thanked 60 Times in 60 Posts

    Re: acCmdFind (A2K SR1)

    OK - that gives a better idea of what you are trying to achieve. You indicated you were having trouble with the command button and sendkeys, but I'm not sure what the sendkeys accomplishes. It seems to me that you should be able to do a .setfocus once the command button is clicked, and then pop up the find window and let the user type in the Clin they are looking for. However, using finds in these situations is not all that efficient, and if your database grows a large size it will get pretty slow.

    A more efficient way is to use the Index of the primary key to jump directly to the record you are looking for. The combo box wizard will generate such a control, but it seems to be a bit flaky in my experience. It uses the Clone Recordset method which isn't quite the same as the older Access97 technique, and apparently isn't always reliable. We use a variation which applies a filter to the main form and has the same effect. If your users are trained to use the Find from the menu or tool bar approach, it will confuse them however, as there is only a single record being shown and you will get failures. Not sure this is helpful, but maybe it will spark an idea.
    Wendell

  5. #5
    Silver Lounger GARYPSWANSON's Avatar
    Join Date
    Aug 2001
    Location
    Frederick, Maryland, USA
    Posts
    1,788
    Thanks
    0
    Thanked 2 Times in 2 Posts

    Re: acCmdFind (A2K SR1)

    You said:
    It seems to me that you should be able to do a .setfocus once the command button is clicked, and then pop up the find window and let the user type in the Clin they are looking for.

    I believe every word you say but can't get it to work. I guess it's time to buy the developers handbook....
    The Form Name is "Funding Master" and the Textbox with data is "CLIN". I tried to set focus to this various ways such as Screen.clin.SetFocus and Forms!stDocName!Clin.SetFocus (stDocName is "Funding Master") and keep receiving an error that an object is missing.

    In the interim, when the user presses the Find Command Button, a message box pops up informing them to Place the cursor in CLIN and press Control F. Not pretty, but it will let me submit a deliverable.

    BTW, is there a way to code this so the Control F feature is activated?
    Regards,

    Gary
    (It's been a while!)

  6. #6
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: acCmdFind (A2K SR1)

    Edited to avoid breaking line in wrong place

    If stDocName is a variable, you can't use
    Forms!stDocName!Clin
    This only works with literal names. For a variable, use
    Forms(stDocName)!Clin

  7. #7
    Silver Lounger GARYPSWANSON's Avatar
    Join Date
    Aug 2001
    Location
    Frederick, Maryland, USA
    Posts
    1,788
    Thanks
    0
    Thanked 2 Times in 2 Posts

    Re: acCmdFind (A2K SR1)

    Thanks Hans,

    I figured this out as well on my own.
    Regards,

    Gary
    (It's been a while!)

Posting Permissions

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