Jump to content

Comparing two ID#'s from different tables


Recommended Posts

Hello,I need to compare two numbers from separate parts (different tables) of the DB. If the numbers are not equal, I need to send a Message box with a button in it to create new record in the one of the tables.Here is the code I has so far...but it needs some work.Private Sub Command152_Click() On Error GoTo Command152_Click_Err If State = "AZ" ThenDoCmd.OpenForm "AZ Fees & Costs" 'open FormDoCmd.RunMacro "Find_on_click_TS2" 'search for a_ TS#\(ID#) and bring up the infoElseIf "Form.AZ Fees & Costs.TS" <> "Macroload.Find_on_click_TS2" Then MsgBox "No Fees & Costs Exist for this TS #"(+ button that will create new record in Form.CA Fees & Costs.TS")ElseIf State = "CA" ThenDoCmd.OpenForm "CA Fees & Costs" 'open FormDoCmd.RunMacro "Find_on_click_TS2" 'search for a_ TS#\(ID#) and bring up the infoElseIf "Form.CA Fees & Costs.TS" <> "Macroload.Find_on_click_TS2" Then MsgBox "No Fees & Costs Exist for this TS # (+ button that will create new record in Form.CA Fees & Costs.TS")ElseMsgBox "State Unknown"End IfCommand152_Click_Exit: Exit SubCommand152_Click_Err: MsgBox Error$ Resume Command152_Click_ExitEnd SubThank you in advance,David92595

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...