Pop-up Box when closing Userform that shows all the information you entered.

Botje

New Member
Joined
Aug 23, 2011
Messages
48
Hey,

After googling and searching this forum this is my last resort again.
All i can find are the "pop-up boxes" that i've already got.

What i am trying to achieve is the following:

I got a userform with 20 check boxes; 1 combobox and 2 txtbox.

I want a box to pop up when closing the form that shows all the information i entered.
Want it to show the following:

#1 Which boxes i've check.
#2 What choice i made in the combobox
#3 What information i filled into the textbox.

I do have boxes that pop-up if the information isn't filled in, and i am trying to achieve a "similair layout".
Code:
   If Me.txtidee.Value = "" Then
    MsgBox "Vul alsjeblieft je idee in.", vbExclamation, "Invulformulier Ideeën Bord"
    Me.txtidee.SetFocus
    Exit Sub
End If

Thanks in advance.

This is the entire code i use for the form.
Code:
Private Sub cmdinvullen_Click()
Dim RowCount As Long
    If Me.TxtNaam.Value = "" Then
    MsgBox "Vul alsjeblieft je naam in.", vbExclamation, "Invulformulier Ideeën Bord"
    Me.TxtNaam.SetFocus
    Exit Sub
End If
    If Me.txtidee.Value = "" Then
    MsgBox "Vul alsjeblieft je idee in.", vbExclamation, "Invulformulier Ideeën Bord"
    Me.txtidee.SetFocus
    Exit Sub
End If
 If Me.ComboBox1.Value = "" Then
    MsgBox "Vul alsjeblieft je team in.", vbExclamation, "Invulformulier Ideeën Bord"
    Me.ComboBox1.SetFocus
    Exit Sub
End If
If MsgBox("Is alles ingevuld?", vbYesNo) = vbYes Then
MsgBox "Proficiat"
End If
RowCount = Worksheets("Archief").Range("B1").CurrentRegion.Rows.Count
With Worksheets("Archief").Range("B1")
.Offset(RowCount, 2).Value = Me.TxtNaam.Value
.Offset(RowCount, 0).Value = Me.txtidee.Value
If Me.chkTijd.Value = True Then
.Offset(RowCount, 30).Value = "Tijd"
Else
.Offset(RowCount, 30).Value = ""
End If
If Me.chkGeld.Value = True Then
.Offset(RowCount, 31).Value = "Geld"
Else
.Offset(RowCount, 31).Value = ""
End If
If Me.chkCollegas.Value = True Then
.Offset(RowCount, 32).Value = "Collega's"
Else
.Offset(RowCount, 32).Value = ""
End If
If Me.chkToestemming.Value = True Then
.Offset(RowCount, 33).Value = "Toestemming"
Else
.Offset(RowCount, 33).Value = ""
End If
If Me.chkRuimte.Value = True Then
.Offset(RowCount, 34).Value = "Ruimte"
Else
.Offset(RowCount, 34).Value = ""
End If
If Me.chkAnders.Value = True Then
.Offset(RowCount, 35).Value = "Anders"
Else
.Offset(RowCount, 36).Value = ""
End If
If Me.chkAchmeaVitale.Value = True Then
.Offset(RowCount, 40).Value = "Achmea Vitale"
Else
.Offset(RowCount, 40).Value = ""
End If
If Me.chkKeuringen.Value = True Then
.Offset(RowCount, 41).Value = "Keuringen"
Else
.Offset(RowCount, 41).Value = ""
End If
If Me.chkKlantenservice.Value = True Then
.Offset(RowCount, 42).Value = "Klantenservice"
Else
.Offset(RowCount, 42).Value = ""
End If
If Me.chkFrontoffice.Value = True Then
.Offset(RowCount, 43).Value = "Frontoffice"
Else
.Offset(RowCount, 43).Value = ""
End If
If Me.chkExoten.Value = True Then
.Offset(RowCount, 44).Value = "Exoten"
Else
.Offset(RowCount, 44).Value = ""
End If
If Me.chkMKB.Value = True Then
.Offset(RowCount, 45).Value = "MO MKB"
Else
.Offset(RowCount, 45).Value = ""
End If
If Me.chkDAM.Value = True Then
.Offset(RowCount, 46).Value = "DAM"
Else
.Offset(RowCount, 46).Value = ""
End If
If Me.chkBA.Value = True Then
.Offset(RowCount, 47).Value = "Bedrijfsartsen en Consulenten"
Else
.Offset(RowCount, 47).Value = ""
End If
If Me.chkRAM.Value = True Then
.Offset(RowCount, 48).Value = "RAM"
Else
.Offset(RowCount, 48).Value = ""
End If
If Me.chkSAM.Value = True Then
.Offset(RowCount, 49).Value = "SAM"
Else
.Offset(RowCount, 49).Value = ""
End If
If Me.chkAMI.Value = True Then
.Offset(RowCount, 50).Value = "MO AMI"
Else
.Offset(RowCount, 50).Value = ""
End If
If Me.chkGMAT5.Value = True Then
.Offset(RowCount, 51).Value = "MO GM AT5"
Else
.Offset(RowCount, 51).Value = ""
End If
If Me.chkICO.Value = True Then
.Offset(RowCount, 52).Value = "Interventie Coördinatoren"
Else
.Offset(RowCount, 52).Value = ""
End If
.Offset(RowCount, 3).Value = Format(Now, "dd/mm/yyyy hh:nn:ss")
End With
    Unload Me
End Sub
Private Sub cmdsluiten_Click()
    Unload Me
End Sub
 
Last edited:

Excel Facts

Wildcard in VLOOKUP
Use =VLOOKUP("Apple*" to find apple, Apple, or applesauce
Something like

Code:
Private Sub cmdinvullen_Click() Dim RowCount As Long
MsgBox("The following were your Userform selections" & vbnewline & "Name of first category: " & Me.TxtNaam.Value & vbnewline & "Name of first category: " and so on
remaining code
 
Upvote 0
Something like

Code:
Private Sub cmdinvullen_Click() Dim RowCount As Long
MsgBox("The following were your Userform selections" & vbnewline & "Name of first category: " & Me.TxtNaam.Value & vbnewline & "Name of first category: " and so on
remaining code


Thanks im going to try this!
 
Upvote 0
Botje

This might be a stupid question, but why do you want/need to do that?
 
Upvote 0
Botje

This might be a stupid question, but why do you want/need to do that?

The for whom this is want this. They want to see some kind of confirmation that they entered the right information.

Should i do this on a different way?


PS. It does work ! Thnx alot.
 
Upvote 0
The data is on the form and getting transferred to the workbook, so I don't see the need to see it one more time.

It's not going to change on it's magical journey between form and worksheet.

I think.
 
Upvote 0
The data is on the form and getting transferred to the workbook, so I don't see the need to see it one more time.

It's not going to change on it's magical journey between form and worksheet.

I think.


Yes that is true indeed. But the people who fill in the form should not be able to see the page where the information is send to.
 
Upvote 0
Something like this will remind the user to review their entries before closing the userform.

Code:
Private Sub UserForm_QueryClose(Cancel As Integer, CloseMode As Integer)
    With Me
        .Left = .Left - .Width
    Cancel = (MsgBox("Is this data correct", vbYesNo) = vbNo)
        .Left = .Left + .Width
    End With
End Sub
 
Upvote 0
Current Code:

Code:
If MsgBox("Je hebt de volgende informatie ingevoerd, klopt dit? " & vbNewLine & "Naam  :        " & Me.TxtNaam.Value & vbNewLine & "Team  :        " & Me.ComboBox1.Value & vbNewLine & "Idee    :        " & Me.txtidee.Value) = vbYesNo Then
MsgBox "Idee ingevoerd!"
End If

Code that was advised:

Code:
Private Sub UserForm_QueryClose(Cancel As Integer, CloseMode As Integer)
    With Me
        .Left = .Left - .Width
    Cancel = (MsgBox("Is this data correct", vbYesNo) = vbNo)
        .Left = .Left + .Width
    End With
End Sub


I tried to combine these codes, so i would have a "Yes/No" button instead I've only managed to produce an "Ok" Button.

I know i should add the vbYesNo into the code.. But Where?

Thanks in advance!
 
Upvote 0
How are you trying to combine them?

I suppose the prompt to review could be in the click event of the button but I'm not sure how you would implement it.

What is it you actually want to happen and in what order?

I'm actually not sure using the QueryClose is needed since you don't actually do anything else in it, eg transfer the data to the worksheet.
 
Upvote 0

Forum statistics

Threads
1,223,911
Messages
6,175,324
Members
452,635
Latest member
laura12345

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top