Hey, I'm a beginning Access 97 app developer holding on to a steep learning curve for dear life. I've encountered a brick wall and was wondering if anyone had a jackhammer I could borrow.
I built a form to enter Headcount information for different functions. Different functions have different roles, some more than others. I've gotten the form to hide empty controls as needed, but am having difficulty either getting role information into a text box or capturing it from a one-line list box.
frmHeadcount is based on tblHeadcount and the Role data is from tblFunction.
Ideally, the query would look to tblFunction, find the field for the chosen function and appropriate role and then place that value into a text box on frmHeadcount. But it seems that the text box can only look to a field in tblHeadcount as defined in the Record Source.
My hack solution was to use locked, one-line list boxes, which look like text boxes. They let me query tblFunction and display the different roles. The problem then became that I couldn’t capture the data in the record, unless I left the list boxes unlocked and asked the users to select the different roles. (Uh…no) There was the additional problem that I would also have to perform more programming gymnastics to get the role information on the Report.
Is there a way to select the lone value of each list box with VBA? I would prefer to use text boxes if someone can help me figure it out.
This post is already long enough. If you need to see what code I already have, I can post it after.
Thanx - Byhl
I built a form to enter Headcount information for different functions. Different functions have different roles, some more than others. I've gotten the form to hide empty controls as needed, but am having difficulty either getting role information into a text box or capturing it from a one-line list box.
frmHeadcount is based on tblHeadcount and the Role data is from tblFunction.
Ideally, the query would look to tblFunction, find the field for the chosen function and appropriate role and then place that value into a text box on frmHeadcount. But it seems that the text box can only look to a field in tblHeadcount as defined in the Record Source.
My hack solution was to use locked, one-line list boxes, which look like text boxes. They let me query tblFunction and display the different roles. The problem then became that I couldn’t capture the data in the record, unless I left the list boxes unlocked and asked the users to select the different roles. (Uh…no) There was the additional problem that I would also have to perform more programming gymnastics to get the role information on the Report.
Is there a way to select the lone value of each list box with VBA? I would prefer to use text boxes if someone can help me figure it out.
This post is already long enough. If you need to see what code I already have, I can post it after.
Thanx - Byhl