Hi, I created a module from a macro in Access 97 and it gave it a name like 'PDI Search Macro' and it looks like:
Function PDI_SEARCH_MACRO()
On Error GoTo PDI_SEARCH_MACRO_Err
DoCmd.OpenForm "Prompt Idea", acNormal, "", "", , acNormal
DoCmd.OpenQuery "PDI SEARCH QUERY MAIN", acNormal, acEdit
DoCmd.OpenQuery "PDI SEARCH QUERY PCP", acNormal, acEdit
DoCmd.OpenQuery "PDI SEARCH QUERY SPC", acNormal, acEdit
DoCmd.OpenQuery "PDI SEARCH QUERY ANC", acNormal, acEdit
DoCmd.OpenQuery "PDI SEARCH QUERY INS", acNormal, acEdit
DoCmd.OpenQuery "TOTAL PDI SEARCH QUERIES", acNormal, acEdit
DoCmd.Close acForm, "Prompt Idea"
DoCmd.OpenReport "rpt_PPD sample columns", acPreview, "", ""
DoCmd.Close acQuery, "PDI SEARCH QUERY ANC"
DoCmd.Close acQuery, "PDI SEARCH QUERY INS"
DoCmd.Close acQuery, "PDI SEARCH QUERY MAIN"
DoCmd.Close acQuery, "PDI SEARCH QUERY PCP"
DoCmd.Close acQuery, "PDI SEARCH QUERY SPC"
DoCmd.Close acQuery, "TOTAL PDI SEARCH QUERIES"
PDI_SEARCH_MACRO_Exit:
Exit Function
PDI_SEARCH_MACRO_Err:
MsgBox Error$
Resume PDI_SEARCH_MACRO_Exit
End Function
However, when I got back to my form and go to the command button's On Click property and [event procedure] -it doesn't show me this function. I look under General and only find something like
Private Sub PDI_SEARCH_MACRO1()
End Sub
Which is the wrong name- Not sure how to connect the code from the converted macro. Thanks.
Function PDI_SEARCH_MACRO()
On Error GoTo PDI_SEARCH_MACRO_Err
DoCmd.OpenForm "Prompt Idea", acNormal, "", "", , acNormal
DoCmd.OpenQuery "PDI SEARCH QUERY MAIN", acNormal, acEdit
DoCmd.OpenQuery "PDI SEARCH QUERY PCP", acNormal, acEdit
DoCmd.OpenQuery "PDI SEARCH QUERY SPC", acNormal, acEdit
DoCmd.OpenQuery "PDI SEARCH QUERY ANC", acNormal, acEdit
DoCmd.OpenQuery "PDI SEARCH QUERY INS", acNormal, acEdit
DoCmd.OpenQuery "TOTAL PDI SEARCH QUERIES", acNormal, acEdit
DoCmd.Close acForm, "Prompt Idea"
DoCmd.OpenReport "rpt_PPD sample columns", acPreview, "", ""
DoCmd.Close acQuery, "PDI SEARCH QUERY ANC"
DoCmd.Close acQuery, "PDI SEARCH QUERY INS"
DoCmd.Close acQuery, "PDI SEARCH QUERY MAIN"
DoCmd.Close acQuery, "PDI SEARCH QUERY PCP"
DoCmd.Close acQuery, "PDI SEARCH QUERY SPC"
DoCmd.Close acQuery, "TOTAL PDI SEARCH QUERIES"
PDI_SEARCH_MACRO_Exit:
Exit Function
PDI_SEARCH_MACRO_Err:
MsgBox Error$
Resume PDI_SEARCH_MACRO_Exit
End Function
However, when I got back to my form and go to the command button's On Click property and [event procedure] -it doesn't show me this function. I look under General and only find something like
Private Sub PDI_SEARCH_MACRO1()
End Sub
Which is the wrong name- Not sure how to connect the code from the converted macro. Thanks.