Senin, 30 April 2012

RE: [MS_AccessPros] Auto fill on form question

 

If not isnull(dlookup("[SUPPersonId]","ActiveInSuppressTable","SUPPersonId =" & me.[Person Id])) then
Control.visible = true ' where control is some kind of red thing (Person already in table msg)
End if

Would this work?

Liz Ravenwood
Database Developer / Programmer
Super First Class Products
B/E Aerospace
O: 1.520.239.4808
www.beaerospace.com

-----Original Message-----
From: MS_Access_Professionals@yahoogroups.com [mailto:MS_Access_Professionals@yahoogroups.com] On Behalf Of luvmymelody
Sent: Monday, April 30, 2012 8:44 AM
To: MS_Access_Professionals@yahoogroups.com
Subject: [MS_AccessPros] Auto fill on form question

Hello all,

We have a form that when the user populates the Employee Id the information auto fills the rest of the form controls. But we would like to add a little more functionality to the form.

What we are trying to do would be to bring up a message box or high light a control if the employee id already exists in another table.
We have a table that tracks certain information and we want the users to know that the id matches the id that they just entered. How could we accomplish this.

Currently there is a macro which I am trying to override with the vba but my code is not working. The code is below.

Private Sub Person_Id_AfterUpdate()

If [Forms]![Employees].[Person Id] = [ActiveInSuppressTable].[SUPPersonId] Then
MsgBox "Record is currently in the Active SUPPress table"
End If

End Sub

Thank You Very much for any help

Jim Wagner

The field on the form that they populate is

Person Id

The field in the other table is named

SUPPersonId

------------------------------------

Yahoo! Groups Links

This email (and all attachments) is for the sole use of the intended recipient(s) and may contain privileged and/or proprietary information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply e-mail and destroy all copies of the original message.

__._,_.___
.

__,_._,___

Tidak ada komentar:

Posting Komentar