Teri Bridges
Member
- Local time
- Today, 08:32
- Joined
- Feb 21, 2022
- Messages
- 187
I have two tables I am working with. Small tables because I am learning. StatusT has four fields, 1. Primary key auto number, 2. Status, 3. Description, and
4. Percent. My Task table has four fields 1. Primary key auto number, 2. Course 3. Status and 4. Percent.
The status fields are short text in both tables and the Percent field is double, percent, two decimal in both tables. So my field types match in both tables.
I created a form, what I am wanting to do is select the Status from a combo box and have it update my TaskT. I did that and it works great. Now what I want to do is have the percent field auto populate based on the percent associated with the status selection from the StatusT. I have read articles and even watched several videos. I have tried the two ways I have seen. First Example - In the control source for the percent field enter the following:
= DLookup("Percent", "StatusT", "Status=" & [Status]) when I open the form the percent field shows #ERROR no matter which status I select.
Second Example - For the Status combo box in the event after update write the following code:
PercentID = DLookup("Percent", "StatusT", "Status='" & StatusID & "'") this results in nothing populating in the percent field.
As I said I am learning, but for the life of me I cannot figure out what I have done wrong. If you have any suggestions I would be most Grateful.
4. Percent. My Task table has four fields 1. Primary key auto number, 2. Course 3. Status and 4. Percent.
The status fields are short text in both tables and the Percent field is double, percent, two decimal in both tables. So my field types match in both tables.
I created a form, what I am wanting to do is select the Status from a combo box and have it update my TaskT. I did that and it works great. Now what I want to do is have the percent field auto populate based on the percent associated with the status selection from the StatusT. I have read articles and even watched several videos. I have tried the two ways I have seen. First Example - In the control source for the percent field enter the following:
= DLookup("Percent", "StatusT", "Status=" & [Status]) when I open the form the percent field shows #ERROR no matter which status I select.
Second Example - For the Status combo box in the event after update write the following code:
PercentID = DLookup("Percent", "StatusT", "Status='" & StatusID & "'") this results in nothing populating in the percent field.
As I said I am learning, but for the life of me I cannot figure out what I have done wrong. If you have any suggestions I would be most Grateful.