PDA

View Full Version : VBA update a table wirh a certificate from an unrelated table



Oblio
03-02-2018, 08:18 AM
I have two tables:

t_MCRs:
MCRs_ID
MCRs_DE_ID ( Short text ) this is the certificate field to update

t_Certificates:
Certificates_ ID
MCRs_DE_ID short text, this is where i need to get tge certificate from. It is a pre-populated table of thousands of certificate numbers)
Assigned? Boolean

What would you reccomend as the best approach to apply these certificates to the MCR table ?

Thank you for your advice !

Bill

ranman256
03-02-2018, 10:34 AM
Is [Assigned] field needed?

if t_MCRs.MCRs_DE_ID is filled in, then its assigned. This is determined by a query.

Oblio
03-02-2018, 10:50 AM
I was thinking that I would need to update the status to assigned=yes, due to my inexperience on how to proceed.

I just do not know how to assign a t_certificates!MCRs_DE_ID to the t_MCRs!MCRs_DE_ID field...as it is not related on anything really....qe are basically just stamping it in. I have actually been pasting them in in datasheet mode...not ideal.

OBP
03-02-2018, 11:20 AM
The Text from the certificate table should NOT be transferred to the MCR table.
The MCR table field should be Number type Long and store the CertificateID, which is presumably an Autonumber field.
If the process of transferring the Certificate is as random as you suggest then I would suggest that you use next available certificate and use a Combo to select it or VBA code to add it to the table.

Oblio
03-02-2018, 12:21 PM
Would you please be able to advise me how to do this with VBA. I do truly understand your reccomendations as that would be the proper way, HOWEVER, we must do it as a batch after the fact....I have been counting the records in t_MCRs, then copying that many certificate numbers and pasting them into the t_MCRs!MCRs_DE_ID field and noting the ones used in the certificates table. Can you please help me with the VBA to do this please???

Thank you sincerely,

Bill

OBP
03-03-2018, 02:52 AM
Do you still have my email address?

Oblio
03-03-2018, 06:03 AM
Not where I am now.... could you please resend to me ?

OBP
03-03-2018, 07:23 AM
Are you still using your fseso email account?

Oblio
03-03-2018, 08:41 AM
Are you still using your fseso email account?

Yes I am...