Results 1 to 6 of 6

Thread: Find Method

  1. #1

    Thread Starter
    Hyperactive Member Rocketdawg's Avatar
    Join Date
    Feb 2003
    Location
    Back in the doghouse
    Posts
    294

    Unhappy Find Method

    Hi Everyone

    I'm creating a database (gratis) for our local food bank, and its
    my first real db.

    I've got most of it hooked up and ready to go, but I've run
    into a snag. (the part I thought was going to be easy!)

    I've looped through the data base and loaded up names into
    a listbox. I'd like the volunteers to be able to select a name
    from the listbox, click a command button and bring up the
    record from the database (Access).

    I'm having syntax meltdown ....Can anyone help me?

    Thank you

  2. #2
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Re: Find Method

    Originally posted by Rocketdawg
    Hi Everyone

    I'm creating a database (gratis) for our local food bank, and its
    my first real db.

    I've got most of it hooked up and ready to go, but I've run
    into a snag. (the part I thought was going to be easy!)

    I've looped through the data base and loaded up names into
    a listbox. I'd like the volunteers to be able to select a name
    from the listbox, click a command button and bring up the
    record from the database (Access).

    I'm having syntax meltdown ....Can anyone help me?

    Thank you
    Are you using ADO or DAO?


    In the button click event,

    VB Code:
    1. Private Sub Command1_Click()
    2. dim thename as string
    3. thename = list1.text
    4.  
    5. 'then you would call a procedure using [thename] in the query string to the database
    6.  
    7. End Sub

    Where exactly are you running into problems?

  3. #3

    Thread Starter
    Hyperactive Member Rocketdawg's Avatar
    Join Date
    Feb 2003
    Location
    Back in the doghouse
    Posts
    294

    Question ADO troubles

    Mendhak (thank you for the reply!)

    I'm using an ADO object.

    I should clarify....

    I can load the fields into where I need them, but the problem is
    this:

    If I have a Field called 'Last Name', how do I loop thru and
    load the actual names in the field? That's the part that has
    me scratching my head.

    In the Field called 'Last Name', are the names in a row that
    I can loop through?

    Sorry to seem overly thick, but I'm really new at ADO.

    Thanks

  4. #4
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Re: ADO troubles

    Originally posted by Rocketdawg
    Mendhak (thank you for the reply!)

    I'm using an ADO object.

    I should clarify....

    I can load the fields into where I need them, but the problem is
    this:

    If I have a Field called 'Last Name', how do I loop thru and
    load the actual names in the field? That's the part that has
    me scratching my head.

    In the Field called 'Last Name', are the names in a row that
    I can loop through?

    Sorry to seem overly thick, but I'm really new at ADO.

    Thanks
    OK, this is what I have understood: you want to loop through all the last name records and put them in a list box.

    VB Code:
    1. objrs.movefirst
    2.  
    3. Do While not objrs.eof
    4. List1.Additem objrs.fields("lastname")
    5. objrs.movenext
    6. Loop


    Is that what you're looking for?

    If I failed to answer your question, my apologies, that is what I have understood. Perhaps you should post whatever code you have so we can get a better understanding of where you're failing.

  5. #5

    Thread Starter
    Hyperactive Member Rocketdawg's Avatar
    Join Date
    Feb 2003
    Location
    Back in the doghouse
    Posts
    294

    Thumbs up It came to me in a vision....

    Mendhak,

    Thanks again for the reply. I got it figured out, and yes
    what you posted was right on the money.

    I couldn't get it through my head that in order to get the
    value of a field, you've got to (Move or MoveNext) to the
    right page in the recordset. Duh. Buddha-like enlightenment
    at 2 in the morning.....

    Anyway, thank you again for the assistance.

    RG

  6. #6
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170
    Lol@buddha.

    YW.

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