F
floyd33 via AccessMonster.com
I have a field on a form that is pulling data from another field. I set up a
macro to set the value of the phone # field to the value of the phone field
in the other table for two different fields that are pulling data from the
same table, but with different RepTypeID's.
rep 1 (SELECT tblRepInformation.RepID, [LastName] & ", " & [FirstName] & "-"
& [SRepID] AS Rep FROM tblRepInformation WHERE (((tblRepInformation.RepTypeID)
=1)) ORDER BY tblRepInformation.LastName
rep 1 "contact" (phone field from tblRepInformation)
rep 2 -named "FRepID" (SELECT tblRepInformation.RepID, [LastName] & ", " &
[FirstName] & "-" & [SalixRepID] AS Rep
FROM tblRepInformation
WHERE (((tblRepInformation.RepTypeID)=2))
ORDER BY tblRepInformation.LastName
rep 2 phone (added phone# to the original table form is on)
I set up the macro to read like this:
SetValue
[Forms]![frmMeeting]![Contact]
DLookUp("Contact","tblRepInformation","RepID=[Forms]![frmMeeting]![RepID]")
or
SetValue
[Forms]![frmMeeting]![Phone#]
DLookUp("Contact","tblRepInformation","RepID=[Forms]![frmMeeting]![FRepID]")
What is happening is very weird. I was having issues altogether, so I
removed the macro from the field. It was oddly still happening, so I DELETED
the macro from the db file. It is still running the action! How is this
possible?
Secondarily, the reason I removed the macro is that the first portion of the
macro (set the value of "contact") was working properly, but when I selected
a record from the "rep2" field, it was changing the contact field to the
rep2's number and deleting the info from rep1 field when it should be leaving
that alone and populating the Phone# field.
Any help is appreciated!
macro to set the value of the phone # field to the value of the phone field
in the other table for two different fields that are pulling data from the
same table, but with different RepTypeID's.
rep 1 (SELECT tblRepInformation.RepID, [LastName] & ", " & [FirstName] & "-"
& [SRepID] AS Rep FROM tblRepInformation WHERE (((tblRepInformation.RepTypeID)
=1)) ORDER BY tblRepInformation.LastName
rep 1 "contact" (phone field from tblRepInformation)
rep 2 -named "FRepID" (SELECT tblRepInformation.RepID, [LastName] & ", " &
[FirstName] & "-" & [SalixRepID] AS Rep
FROM tblRepInformation
WHERE (((tblRepInformation.RepTypeID)=2))
ORDER BY tblRepInformation.LastName
rep 2 phone (added phone# to the original table form is on)
I set up the macro to read like this:
SetValue
[Forms]![frmMeeting]![Contact]
DLookUp("Contact","tblRepInformation","RepID=[Forms]![frmMeeting]![RepID]")
or
SetValue
[Forms]![frmMeeting]![Phone#]
DLookUp("Contact","tblRepInformation","RepID=[Forms]![frmMeeting]![FRepID]")
What is happening is very weird. I was having issues altogether, so I
removed the macro from the field. It was oddly still happening, so I DELETED
the macro from the db file. It is still running the action! How is this
possible?
Secondarily, the reason I removed the macro is that the first portion of the
macro (set the value of "contact") was working properly, but when I selected
a record from the "rep2" field, it was changing the contact field to the
rep2's number and deleting the info from rep1 field when it should be leaving
that alone and populating the Phone# field.
Any help is appreciated!