Results 1 to 2 of 2

Thread: VB help

  1. #1

    Thread Starter
    New Member
    Join Date
    Jun 1999
    Location
    Kallangur, QLD Australia
    Posts
    1

    Post

    Dear Sir,

    I started learning VB only twelve months ago and although I find it fascinating, I must agree that I am still very green to visual programming. Everything that I know now has been self taught, using books and tips from the internet. I have created a few (very simple) applications which I am very proud of.

    I am now working on a project where I need a little help from experienced VB programmers like you.

    In order to keep in touch with relatives and friends, I have created a simple database in MS Access where I store, in a table their Surnames, First Names, Addresses, Phone Numbers etc
    I have also created a query and form from that table, where I inserted in the “Surname” column/criteria the following message: [Please Enter Surname]. When I run the form, an input box appears, and prompts me to enter a surname. After entering a surname eg Smith, (as you guessed it) the first record with the name Smith appears on the form and gives me all relevant details about the record. This works fine.

    I have created a new project in VB based on the above mentioned database and when I run the application, the form that is loaded always shows the first record on the database. As it is not possible to include queries from Access where a criteria exists, or include a form created in Access in a VB project, I would like to know, How to write a code that will prompt me (through an input box) to enter a “Surname”, in order to retrieve the first record in the DB with the Surname entered in the Input Box.

    Your help will be greatly appreciated


    Regards


    Rene Schmitt

  2. #2
    Lively Member
    Join Date
    Jun 1999
    Location
    Raleigh, NC
    Posts
    70

    Post

    You could use an InputBox to provide the prompt, but why make your user remember the Surname they want to see? Why not provide a combo box on the form with all the Surnames. The user can scroll thru the list, click on the desired Surname, and you can use the combobox_click event to do your lookup.

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