I'm an experienced SQL programmer but I'm finding I know diddly-squat about Access.
I'm trying to make the simplest of text boxes on a form. I want to display a person's age just to the right of where they would input a birthdate. My age calculation works like a charm, putting the value in "agenow". I don't want "agenow" to be open for input, just a display variable. Here is the code for [agenow] to let you know it does work:
Private Sub Form_Current()
Dim agenow As Integer
agenow = DateDiff("yyyy", [DOB], Now())
If (Format([DOB], "mmdd") > Format(Now(), "mmdd")) Then
agenow = agenow - 1
End If
My problem is:
1. I don't know how to show this variable in a text box.
2. When it does show, I want it protected. It's just information only.
3. I've attached my screen print of the form.
4. If you can show me a working example of a variable in a text box, I sure would like to see it.
Can you help this dinosaur out? I do a simple Google search on "how do you make a text box in Access" and I get answers on how I make it html ready, how to make hyperlinks, videos on youtube about entering data into a text box. I'm sure a 5th grader knows this answer, so can you help? I don't think "I'm smarter than a 5th grader" right now.
Thank you.
I'm trying to make the simplest of text boxes on a form. I want to display a person's age just to the right of where they would input a birthdate. My age calculation works like a charm, putting the value in "agenow". I don't want "agenow" to be open for input, just a display variable. Here is the code for [agenow] to let you know it does work:
Private Sub Form_Current()
Dim agenow As Integer
agenow = DateDiff("yyyy", [DOB], Now())
If (Format([DOB], "mmdd") > Format(Now(), "mmdd")) Then
agenow = agenow - 1
End If
My problem is:
1. I don't know how to show this variable in a text box.
2. When it does show, I want it protected. It's just information only.
3. I've attached my screen print of the form.
4. If you can show me a working example of a variable in a text box, I sure would like to see it.
Can you help this dinosaur out? I do a simple Google search on "how do you make a text box in Access" and I get answers on how I make it html ready, how to make hyperlinks, videos on youtube about entering data into a text box. I'm sure a 5th grader knows this answer, so can you help? I don't think "I'm smarter than a 5th grader" right now.
Thank you.
Attachments
Last edited: