Consulting

Results 1 to 3 of 3

Thread: Excel form to database help

  1. #1

    Excel form to database help

    Hi
    hope you're ok.

    I've created a userform in Excel and wanted to know how I can get the information entered into the userform into a database?

    Here's the scenario.

    I want the userform to collect data I.E Hotel booking request

    Then once the user has entered all of the information into the form, they click a button, form is closed and a unique reference number is generated in a dialogue box.

    Then the booking team can access a booking queue where all the submitted booking requests are,

    We have already have this kind of thing in place and Visual Basic and SQL are used.

    If you can point me in the right direction that would be fantastic.

    I'm new to VBA and SQL however I pick things up quite quickly

    Any help would be much appreciated.

    Thanks
    Mark

  2. #2
    VBAX Expert JP2112's Avatar
    Joined
    Oct 2008
    Location
    Astoria, NY
    Posts
    590
    Location
    After clicking the button, you can read the form fields using the syntax Me.ControlName.Value. For example, if you have a textbox called "ZipCode", you read the value using Me.ZipCode.Value.

    There are several ways you can collect the information from the form and write to a db.

    You can use class modules to create objects that hold the values from your form. For a hotel booking, you would need at least 2 class modules: one to represent the customer, the other for the request (i.e. hotel room).

    You should mention what sort of db you have (Access?), someone might be able to provide sample code for that.

  3. #3
    VBAX Tutor
    Joined
    Sep 2007
    Posts
    265
    Location
    it seems to long discussions. have you tried to explore some sample code program from this wonderful forum.

    if you had a problem with the code, then you could share with us. I believe, expertise here will glad to help you

    Best, harto

Posting Permissions

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