C
cwAFcontractor
I'm new to this Access Database world and i'm tasked with creating a database
to keep track of the inventory in my shop. I'm creating a form that will
imput information into a table. On this Form there is a section at the bottom
where you can put the Authorizing information. There is a combo box which you
can select the authorizing party (only two as of right now), and two text
boxs (one is email of AP and the other is Phone of AP). What i would like to
happen is when the AP is selected in the combo box i would like the
corrisponding email and phone be imput into the corresponding text boxes.
I have no idea how to start this. I have tried reading a few threads and
books but can't find exactly what i'm looking for. I have tried to do the
afterupdate wizard when you used more then one column in the combo box wizard
and don't think i did it right because it messed up the combo box and only
gave one option with all the info on one line. I also tried writing a vb code
to imput the information but dont think i did that right either because
nothing happened when i selected the option in the combo box. As long as i
have only one column in the combo box it works fine for the combo box but i
can't get the info populated. below is the vb code that i used but didnt work.
Private Sub enterdata_AfterUpdate()
Set Number = Form_COTSRequest.CORPhoneNumber
Set Email = Form_COTSRequest.COREmail
If CmbCORName = "fn ln" Then
Number = "XXX-225-XXX9"
Email = "[email protected]"
ElseIf CmbCORName = "MSgt fn Ln" Then
Number = "XX-225-XXX8"
Email = "[email protected]"
End If
End Sub
to keep track of the inventory in my shop. I'm creating a form that will
imput information into a table. On this Form there is a section at the bottom
where you can put the Authorizing information. There is a combo box which you
can select the authorizing party (only two as of right now), and two text
boxs (one is email of AP and the other is Phone of AP). What i would like to
happen is when the AP is selected in the combo box i would like the
corrisponding email and phone be imput into the corresponding text boxes.
I have no idea how to start this. I have tried reading a few threads and
books but can't find exactly what i'm looking for. I have tried to do the
afterupdate wizard when you used more then one column in the combo box wizard
and don't think i did it right because it messed up the combo box and only
gave one option with all the info on one line. I also tried writing a vb code
to imput the information but dont think i did that right either because
nothing happened when i selected the option in the combo box. As long as i
have only one column in the combo box it works fine for the combo box but i
can't get the info populated. below is the vb code that i used but didnt work.
Private Sub enterdata_AfterUpdate()
Set Number = Form_COTSRequest.CORPhoneNumber
Set Email = Form_COTSRequest.COREmail
If CmbCORName = "fn ln" Then
Number = "XXX-225-XXX9"
Email = "[email protected]"
ElseIf CmbCORName = "MSgt fn Ln" Then
Number = "XX-225-XXX8"
Email = "[email protected]"
End If
End Sub