A community for students.

Here's the question you clicked on:

55 members online
  • 0 replying
  • 0 viewing

anonymous

  • 4 years ago

Hello everyone, Can you please tell me how to make a field a function of another field in VB6 using access database?

  • This Question is Closed
  1. anonymous
    • 4 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    I didn't get you. can you make it more clear?

  2. anonymous
    • 4 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    ??

  3. anonymous
    • 4 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    I am working on a hotel database. I have two fields, one room number and the other room class. I want the field room class be a function of room number. For example for the rooms between 1 & 20, it'd be C; for 21 to 40 it's be B and for 41 to 60 it'd be A. Any idea how can I do that?

  4. anonymous
    • 4 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    You can write a code in your program to do this. In your input form, if someone inputs the room number set the values A,B,C according to the condition to a another text field automatically. Also disable the textbox so that no one can edit the automatically assigned value. Save the texts in database as usual. For example. write the if statements inside the module Private Sub Text1_Change() .......................... ........................ <if statements here like below> if val(text1.text)>=1 and val(text1.text)<=40 then text2.text="A" ....................... ......................... End Sub I hope that this will help you or at least provide a hint.

  5. anonymous
    • 4 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    Actually I entered the values manually using Access. But I found that I have to use ADODB in order to make a field a function of another field. For example: Dim RS as New ADODB.Recordset RS!Age= Year(Date) - Year(RS!Birthdate) Thanks for your reply btw! :)

  6. Not the answer you are looking for?
    Search for more explanations.

    • Attachments:

Ask your own question

Sign Up
Find more explanations on OpenStudy
Privacy Policy

Your question is ready. Sign up for free to start getting answers.

spraguer (Moderator)
5 → View Detailed Profile

is replying to Can someone tell me what button the professor is hitting...

23

  • Teamwork 19 Teammate
  • Problem Solving 19 Hero
  • You have blocked this person.
  • ✔ You're a fan Checking fan status...

Thanks for being so helpful in mathematics. If you are getting quality help, make sure you spread the word about OpenStudy.

This is the testimonial you wrote.
You haven't written a testimonial for Owlfred.