Results 1 to 8 of 8
  1. #1
    Join Date
    Sep 2014
    Posts
    4

    Unanswered: stLinkCriteria Issue... Help. Please.

    Ok. I have built a Listbox and when you double click one of the records in this listbox it is suppose to open the data in another form.

    So i got the query below to open the other form but its just not populating the data... it errors and I cant figure out why. When I hover over the query in VB after it errored to debug it shows the ID of the record I double clicked but its not pulling the data....

    WHAT am I doing wrong! Help!

    Query:
    Private Sub SearchResults_DblClick(Cancel As Integer)

    Dim stDocName As String
    Dim stLinkCriteria As String

    stDocName = Forms![Compliance Form].[Update Compliance Certifications].SetFocus

    stLinkCriteria = "[IDUpdate]=" & Me![SearchResults]

    DoCmd.OpenForm stDocName, , , stLinkCriteria


    End Sub

    The text above is where the debug tells me there is an issue. The error I got when trying to do this is "The action or method requireds a Form Name argument."

    Ideas? Fixes?

  2. #2
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    the error message is telling you that you have not provided a valid name of the form to be opened
    so stDocName should contain the name of the form to be opened
    Code:
    stDocName = Forms![Compliance Form].[Update Compliance Certifications].SetFocus
    im guessing it should read
    Code:
    stDocName = "Compliance Form"
    ie the name of the form to be opened
    Last edited by healdem; 09-26-14 at 14:02.
    I'd rather be riding on the Tiger 800 or the Norton

  3. #3
    Join Date
    Sep 2014
    Posts
    4

    Reply1

    This is a tabbed form, hence my issues. I cant figure out how to have it populate into the tabbed form.

    Main Compliance Form
    Tab1 New Compliance Certifications
    Tab2 Search Compliance Certifcations
    Tab3 Update Compliance Certifications

    Using Tab2 you can search the db items with specified criteria however I want to all the user to double click the item and pop it up in tab3 to update or read all the information on those items its not working... grrr.

  4. #4
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    so are you trying to switch to a tab on the current form as opposed to opening a form?

    https://www.google.co.uk/webhp?sourc...ic+tab&spell=1
    I'd rather be riding on the Tiger 800 or the Norton

  5. #5
    Join Date
    Sep 2014
    Posts
    4

    Reply2

    I spent almost a day and half trying to understand it. I thought if I posted the code someone could help me understand and see my mistake and what I was missing.

    Thanks, I will continue to read and figure it. Or just build a different form and not tab it. Thanks.

  6. #6
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    What I think you are trying to do is switch the focus to a specific tab that is effectively already open in the current for. but its hard to tell from what you are saying. its hard to diagnose from your code as it doesn't make sense (or at least not to me). by trying to set a formname by using the setfocus property is frankly gibberish. its impossible to work out what you actually want to do from that

    so 'all' you need to do is display that tab. that means set the appropriate property on your tab control
    I'd rather be riding on the Tiger 800 or the Norton

  7. #7
    Join Date
    Sep 2014
    Posts
    4

    Reply4

    I dont understand enough about how to use the tabs in the form and get what I want. Seperate forms easy but this "tab control" part I am having trouble understanding it.

    I all the other pieces of it put together this is the last part, I will get.

    Thank you.

  8. #8
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    sorry, with this sort of problem its tricky to describe a solution without actually seeing the problem. if you are still stuck I'd recommend that you post a ZIPped copy of your db here as an attachment, remove any sensitive data first. say which form is exhibiting the symptoms and people will try and help
    I'd rather be riding on the Tiger 800 or the Norton

Posting Permissions

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