Can you please tell me how to make a field a function of another field in VB6 using access database?
Stacey Warren - Expert brainly.com
Hey! We 've verified this expert answer for you, click below to unlock the details :)
At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum deleniti atque corrupti quos dolores et quas molestias excepturi sint occaecati cupiditate non provident, similique sunt in culpa qui officia deserunt mollitia animi, id est laborum et dolorum fuga.
Et harum quidem rerum facilis est et expedita distinctio. Nam libero tempore, cum soluta nobis est eligendi optio cumque nihil impedit quo minus id quod maxime placeat facere possimus, omnis voluptas assumenda est, omnis dolor repellendus.
Itaque earum rerum hic tenetur a sapiente delectus, ut aut reiciendis voluptatibus maiores alias consequatur aut perferendis doloribus asperiores repellat.
I got my questions answered at brainly.com in under 10 minutes. Go to brainly.com now for free help!
I didn't get you. can you make it more clear?
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?
Not the answer you are looking for? Search for more explanations.
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 val(text1.text)>=1 and val(text1.text)<=40 then
I hope that this will help you or at least provide a hint.
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.
Dim RS as New ADODB.Recordset
RS!Age= Year(Date) - Year(RS!Birthdate)
Thanks for your reply btw! :)