Recordset object question

SGT68

Registered User.
Local time
Today, 03:02
Joined
May 6, 2014
Messages
76
I got this function which is supposed to find a record based on the primary key, and then give three fields a value if they should be empty.
---------------------
Public Function DoesXrefExist(faPersonID As Long, faRoleCode As String, faDorpID As Long, faDorpCode As String)


If (DLookup("PersonID", "PEOPLE", "PersonID =" & faPersonID) > 0) Then
... blah blah

End Function
-----------------------------------------

Thats as far as i have got...for the next part
I get the feeling that i need to use the recordset object that exists somewhere.
How do i access that recordset object? I have not been using any DAO or ADO, just straight VBA. I know i can create recordsets and stuff using DAO/ADO, but there must be a recordset that has been created already by the Dlookup command...
 
I'm sensing that you either want a search form or there's a normalisation problem. Why do you need to carry over three values from one table to a form?
 
I'm sensing that you either want a search form or there's a normalisation problem. Why do you need to carry over three values from one table to a form?
Good point. I might build in another m to m relationship with a junction table to handle this situation.. m to m relationships are just such hard work, in this case in particular cos the table has a composite key... its not my design i'm rebuilding someone elses totally dodgy database with crazy business logic.(admittedly the composite key was my addition) .It does my head in at times. Its an admin system for a charity umbrella organization.
 
You can also remove the composite keys and handle that at form level then use an Autonumber/Number PK in the same table to link to the other table(s). So there won't be a need for another junction table.

Perhaps you can list out the relevant fields in the two tables and we can take a look.
 

Users who are viewing this thread

Back
Top Bottom