I have this code which pulls up specific forms based on 'dsuf'. If dsuf = RGA, it pulles up the forms with RGA. I have another field called dpre. 'dpre' and 'dsuf' make up the forms ID. dpre and dsuf are stored in a table. Is there a way to combine these two groups of code so that if a form has an ID=dpre and dsuf, that form gets pulled out. For example,
if the user inputs dpre=RGA, and dsuf=SHA, the code will pull out the form with the ID=RGA SHA. dpre and dsuf are both text fields. I was thinking maybe use a for loop that goes through each row of the table and see which row has the specific dpre and dsuf (not sure how to write the VB code for that). Any suggestions would be very helpful. I am really pressed on time so your help would greatly be appreciated. Thanks in advance.
if the user inputs dpre=RGA, and dsuf=SHA, the code will pull out the form with the ID=RGA SHA. dpre and dsuf are both text fields. I was thinking maybe use a for loop that goes through each row of the table and see which row has the specific dpre and dsuf (not sure how to write the VB code for that). Any suggestions would be very helpful. I am really pressed on time so your help would greatly be appreciated. Thanks in advance.
Code:
DoCmd.OpenForm "Dockets Data Input Form", acNormal, "", "", , acNormal
DoCmd.GoToControl "Patent Type"
DoCmd.FindRecord Forms![Invention Disclosure Input Form]![dsuf]
DoCmd.OpenForm "Dockets Data Input Form", acNormal, "", "", , acNormal
DoCmd.GoToControl "Prefix"
DoCmd.FindRecord Forms![Invention Disclosure Input Form]![dpre]