Results 1 to 2 of 2

Thread: Help with Code to open a form at specific record.....HELP HELP

  1. #1

    Thread Starter
    New Member
    Join Date
    Mar 2010
    Posts
    1

    Help with Code to open a form at specific record.....HELP HELP

    hi
    i'm not expert in writting vb codes.
    but there's this IT project im doing in access i need help with i'll be very thankfull.
    I don't know if my code is fine i have just been learning from different site and came up with this code.
    .
    .
    .
    Basically i have this database which stores customer details in frm_customers but then the problem is that i have this button called "view/edit customer" what i want it to do is that when i click this button an input box pop ups and asks user for a customer ID he wants to go to, then it opens frm_customers to that specific record using CustomerID. i have these codes stated below but they are not working:

    Private Sub Command105_Click()
    Dim stDocName As String
    Dim stCustomerId As String

    stDocName = "frm_customers"
    stCustomerId = InputBox "Enter Customer Id you want to go to?", "Customer Search"
    DoCmd.openform = stDocname
    DoCmd.GoToRecord stCustomerId

    End Sub

    Help me please.
    Thankyou Very Much!

  2. #2
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    41,929

    Re: Help with Code to open a form at specific record.....HELP HELP

    Thread moved to 'Office Development/VBA' forum... note that while it certainly isn't made clear, the "VB Editor" in Office programs is actually VBA rather than VB, so the 'VB6' forum is not really apt

Posting Permissions

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



Click Here to Expand Forum to Full Width