convert non working macro to VBA

setis

Registered User.
Local time
Yesterday, 22:04
Joined
Sep 30, 2017
Messages
127
I was using the following Openform macro to go to a specific record from a subform:

[ClaimID]=[Forms]![frmMemberDB]![frmClaimsList].[Form]![ClaimID]

suddenly it is not working and it is taking me to a new record on the target form.

Could somebody let me know the correct GoToRecord syntaxis for the above?

I tried the automatic Macro to VBA conversion and I get the same results

Thank you in advance
 
What is the VBA that it generated ?
 
the conversion would be:

DoCmd.OpenForm "yourFormName",,,"[ClaimID]=" & Forms!frmMemberDB!frmClaimList.Form!ClaimID
 
What is the VBA that it generated ?
Code:
Private Sub Name_PrimaryICDCode__Click()
On Error GoTo Name_PrimaryICDCode__Click_Err

    DoCmd.OpenForm "frmClaims", acNormal, "", "[ClaimID]=[Forms]![frmMemberDB]![frmClaimsList].[Form]![ClaimID]", , acNormal


Name_PrimaryICDCode__Click_Exit:
    Exit Sub

Name_PrimaryICDCode__Click_Err:
    MsgBox Error$
    Resume Name_PrimaryICDCode__Click_Exit

End Sub
 
the conversion would be:

DoCmd.OpenForm "yourFormName",,,"[ClaimID]=" & Forms!frmMemberDB!frmClaimList.Form!ClaimID

Thanks!I get the error "MA can't find the field 'frmClaimList' referred to in your expression"

"frmClaimList" is a subform in "frmMemberDB", that's taken into consideration in your expression. right?
 
There is one thing that I find weird. When I open frmClaims, instead of having access to all the records, there is only one.
All the claims are there when I open the table, but opening the form, there is only a blank form with no access to browse all records.
This might have something to do with the error.
 
I think it should be;

Code:
 DoCmd.OpenForm "frmClaims", acNormal, "", "[ClaimID]= " & [Forms]![frmMemberDB]![frmClaim[COLOR="Red"]s[/COLOR]List].[Form]![ClaimID], , acWindowNormal

According to the code generated - check the spelling?
 
There is one thing that I find weird. When I open frmClaims, instead of having access to all the records, there is only one.
All the claims are there when I open the table, but opening the form, there is only a blank form with no access to browse all records.
This might have something to do with the error.

Check you haven't saved the form with a filter set in it's properties.
 

Users who are viewing this thread

Back
Top Bottom