Solved Customize MsgBox on Macro (1 Viewer)

Sarah.M

Member
Local time
Today, 14:31
Joined
Oct 28, 2021
Messages
335
Hi, Plz note, My VBA is blocked by IT for security reason.
I can use only Expression builder, Macros, Queries, Tables, Forms and Reports only.
------------------------------------------------
Hi,
I have Form has [UserName] field and I have button [Submit]
1 If I click on Submit button I want MsgBox pup up to me said
2 [UserName] are you sure you want to submit it? (Yes or No) and then if I click yes
3 I want MsgBox to say
4 [UserName] you have Submitted successfully

I try this but it dose not work with me :(
MsgBox([UserName] & &"Are you sure you want to submit it"?,36)
MsgBox([UserName] & &"you have Submitted successfully"?,36)

Database Sample attached

plz help 🙏
1646810702459.png
 

Attachments

  • 11.accdb
    1.9 MB · Views: 230

SHANEMAC51

Active member
Local time
Today, 14:31
Joined
Jan 28, 2022
Messages
310
I can use only Expression builder, Macros, Queries, Tables, Forms and Reports only.
if your macro is translated into code, we will get clearly not what we wanted

Code:
Function Macro1()
On Error GoTo macro1_egg


    With CodeContextObject
        ' How do I combine the field with the text?
        If (MsgBox(.UserName, 36)) Then
        End If
        ' If I click on Yes Macro will run, If I click to No he will stop run
        Exit Function
        If (MsgBox(.UserName, 36)) Then
        End If
    End With
 

Sarah.M

Member
Local time
Today, 14:31
Joined
Oct 28, 2021
Messages
335
if your macro is translated into code, we will get clearly not what we wanted

Code:
Function Macro1()
On Error GoTo macro1_egg


    With CodeContextObject
        ' How do I combine the field with the text?
        If (MsgBox(.UserName, 36)) Then
        End If
        ' If I click on Yes Macro will run, If I click to No he will stop run
        Exit Function
        If (MsgBox(.UserName, 36)) Then
        End If
    End With
Kindly can you guide me in Macro plz?
 

SHANEMAC51

Active member
Local time
Today, 14:31
Joined
Jan 28, 2022
Messages
310
they should have received about
Code:
Function Макрос11()
On Error GoTo Макрос11_Err

    TempVars.Add "a1", MsgBox(Forms!UserF!UserName, 36, "text")
    If (TempVars!a1 = 6) Then
        MsgBox """m6""", vbOKOnly, ""
        Exit Function
    Else
        Beep
        MsgBox """m7""", vbOKOnly, ""
    End If


Макрос11_Exit:
    Exit Function

Макрос11_Err:
    MsgBox Error$
    Resume Макрос11_Exit

End Function
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 19:31
Joined
May 7, 2009
Messages
19,169
see you message.
 

Attachments

  • 11.accdb
    1.9 MB · Views: 240

Users who are viewing this thread

Top Bottom