Hi,
How can I create msgbox without default button?
Is it possible?
Hi,
How can I create msgbox without default button?
Is it possible?
Sorry but I'm not sure what you want. No buttons? How do you dismiss the MsgBox?
I've created a program in Access to scan barcode.
If scanned barcode that is not in the database I get a message ...
In MsgBox I have the buttons yes and no.
My problem is if they continue to scan the notice is confirmed over the scanner.
I wish that could be confirmed only through the mouse.
Is this possible?
You do know you can set the button that has the default focus, right?
I don't know how to set focus.
I know how to set defaul button, but don't set focus.
Can you help me?
How about posting your MsgBox line of code for us to see?
Private Sub Skeniranje_Click()
Dim Sken As String
DoCmd.SetWarnings False
Sken = "?"
While Sken = "?"
Sken = InputBox("Upiši barkod", "Sken", , 1, 15)
If Sken <> "" Then
CurrentDb.Execute "INSERT INTO Sken VALUES ('" & Sken & "');"
Me.Refresh
Sken = "?"
If IsNull(Forms![frmSkeniranje]![qSkenUkupno subform].Form![Artikl]) Then
MsgBox "Artikl nije u bazi,", vbOKOnly + vbInformation, "Obavijest"
End If
End If
Wend
End Sub
Last edited by mladen273; 02-16-2013 at 03:43 PM. Reason: Wrong code
The Default button is the one that gets the focus. Your scanner is undoubtedly supplying a CarriageReturn at the end of the scan and that presses the button with the focus (default).
Ahh...a vbOKOnly MsgBox. Hmm...<scratches head>
You may be stuck here simply coming up with your own form for a Message that requires the user to enter a certain sequence in a TextBox to dispatch the warning form and prove they have seen it.
You're not confused, Allan! Well, no more than we usually are! The OP did say that in his Messagebox "...I have the buttons yes and no..."
How about a simply Popup/Modal Form with a Button captioned "OK," but coded to close the Form, or do whatever else needs to be done?
Linq ;0)>
Can someone help me with this problem?
How can I create focus to form?
I have try with code before msgbox form.focus but nothing is happend.
How about a standard MsgBox with two buttons and the 2nd button has the focus. You can test the results and not accept the default button and put up the MsgBox again?
Try something like the following:
...WARNING: UNTESTED CODE...Code:Private Sub Skeniranje_Click() Dim Sken As String ' DoCmd.SetWarnings False Sken = "?" While Sken = "?" Sken = InputBox("Upiši barkod", "Sken", , 1, 15) If Sken <> "" Then CurrentDb.Execute "INSERT INTO Sken VALUES ('" & Sken & "');" Me.Refresh Sken = "?" If IsNull(Forms![frmSkeniranje]![qSkenUkupno subform].Form![Artikl]) Then Dim MyAnswer As Integer MyAnswer = vbCancel Do While MyAnswer = vbCancel MyAnswer = MsgBox("Artikl nije u bazi,", vbOKCancel + vbCritical + vbDefaultButton2, "Obavijest") Loop End If End If Wend End Sub
Thx, this is awsome, finally is working.Try something like the following:
...WARNING: UNTESTED CODE...Code:Private Sub Skeniranje_Click() Dim Sken As String ' DoCmd.SetWarnings False Sken = "?" While Sken = "?" Sken = InputBox("Upiši barkod", "Sken", , 1, 15) If Sken <> "" Then CurrentDb.Execute "INSERT INTO Sken VALUES ('" & Sken & "');" Me.Refresh Sken = "?" If IsNull(Forms![frmSkeniranje]![qSkenUkupno subform].Form![Artikl]) Then Dim MyAnswer As Integer MyAnswer = vbCancel Do While MyAnswer = vbCancel MyAnswer = MsgBox("Artikl nije u bazi,", vbOKCancel + vbCritical + vbDefaultButton2, "Obavijest") Loop End If End If Wend End Sub
B.R.
Mladen