Simple VB 2008 Question

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Dellboymash
    New Member
    • Feb 2008
    • 9

    Simple VB 2008 Question

    Apologies, I have posted this question before, but am still looking for an answer, and have therefore rephrased the question.

    Users enter data into the database using a windows form. I am happy I have this working and can create records in a SQL 2000 database fine

    However there are some fields that have a default value that the user doesn't need to enter, but I want them to be included in the database record they are creating. One of these fileds is called hotel

    I have a dataset called employeesdatase t
    within the dataset is a table called employees
    within the table is a field called hotel. I also have a variable field called @hotelno
    which = 41


    I want to set the value of the hotel field (within the current record the form is creating) to @hotelno (41)

    The other fields within the current record are bound to the form are are inputted by the user.

    The hotel field is not a field on the form but is held within the record.

    How to I make the field Hotel=@hotelno or 41 before saving the record?
  • Dököll
    Recognized Expert Top Contributor
    • Nov 2006
    • 2379

    #2
    That's okay, Dellboymash!

    And sorry for your troubles... Would you be able to post part of your code for looks?

    I have been toying with VB Express 2005, can't be too far off 2008. Have you looked at example videos to see if there are ideas there?

    Also, is @hotelno an AutoNumber, you seemed to be saying it is generated but not part of the form, in which case reading this back to your form should be flawless if you SELECT * from YourTable, you'd get hte AutoNumber added in the back-end for hotelno.

    Please tell us more or post what you ahve thur far for a closer look.

    In a bit!

    Dököll

    Comment

    Working...