I am having 2 problems with a portion of a form I am creating. The way it is set up is that there is a dropdown with 3 options (contract, project request, and other). If contract is selected, another dropdown appears with projects related to contract, if project request is selected, a dropdown appears with projects related to project requests, and if other is selected, a textbox appears for text to be entered. I've done that using .Visible (I will post the code below).
Now, the first problem is that if the user makes an original choice, then selects a project, then changes his choice in the first dropdown box, the first project that was selected is still being stored. How do I undo the storage of the first project choice? I was thinking of using .Undo, but I don't think the code I used is correct. Here is what I tried to use:
The next problem is that I have the form set to be continuous, and when one option in the first dropdown is selected on one record, the same is selected for all the others. Is there a way to make it so the selection is only for the record you are on and have it not affect the other records?
Thanks for your help!
G
Code:
Private Sub Service_Bound_By_AfterUpdate()
If Me![Service Bound By] = "Project Request" Then
Project_Name.Visible = True
ProjectName.Visible = False
IfOther.Visible = False
ElseIf Me![Service Bound By] = "Contract" Then
Project_Name.Visible = False
ProjectName.Visible = True
IfOther.Visible = False
ElseIf Me![Service Bound By] = "Other" Then
Project_Name.Visible = False
ProjectName.Visible = False
IfOther.Visible = True
End If
End Sub
Now, the first problem is that if the user makes an original choice, then selects a project, then changes his choice in the first dropdown box, the first project that was selected is still being stored. How do I undo the storage of the first project choice? I was thinking of using .Undo, but I don't think the code I used is correct. Here is what I tried to use:
Code:
Private Sub Service_Bound_By_BeforeUpdate(Cancel As Integer)
If Me![Service Bound By] = "Project Request" Then
ProjectName.Undo
IfOther.Undo
ElseIf Me![Service Bound By] = "Contract" Then
Project_Name.Undo
IfOther.Undo
ElseIf Me![Service Bound By] = "Other" Then
Project_Name.Undo
ProjectName.Undo
End If
End Sub
The next problem is that I have the form set to be continuous, and when one option in the first dropdown is selected on one record, the same is selected for all the others. Is there a way to make it so the selection is only for the record you are on and have it not affect the other records?
Thanks for your help!
G