How To Hide Inputbox By Vba (Access) Programming Follow

0
Avatar
Legacy Poster

I cannot hide a message box called from a Bartender model, when a take BarTender control with MS-ACCESS using the following code :

Public Function imprimer(nbcopies, refsurg, Lot, ModeleBt, Imprimante)
Dim MyApp As BarTender.Application
Dim MyDoc As New BarTender.Format
Dim MyVars As BarTender.SubString
Dim Str1, Str2 As String

Set MyApp = CreateObject("BarTender.Application")
[b]MyApp.Visible = False[/b]

Str1 = ModeleBt
Str2 = Imprimante

Set MyDoc = MyApp.Formats.Open(Str1, False, Str2)

MyDoc.SetNamedSubStringValue "NumLot", Lot

MyDoc.Databases.QueryPrompts.GetQueryPrompt("Invite1").value = refsurg


MyDoc.IdenticalCopiesOfLabel = nbcopies

MyDoc.PrintOut

MyApp.Quit (BarTender.BtSaveOptions.btDoNotSaveChanges)
Set MyDoc = Nothing
Set MyApp = Nothing

End Function


In BarTender, the input box is called by the following script, linked to a field :

If (Field("RBarTenderLisam.NumeroLot")=1) then
Value=0
Do Until Len(Value)=8
Value=InputBox("Entrer numéro de lot (8 chiffres)")
Loop
Else
Value="12345678"
End If


Can somebody help me ?

Tanks

PS : trying the folowing instructions, founded an your forum,
'Disable record selection dialog
MyDoc.PrintSetup.SelectRecordsAtPrint = False

'Disable user prompt
MyDoc.PrintSetup.EnablePrompting = False

give an error message !

2 comments

0
Avatar
Domingo Rodriguez
Moderator
Comment actions Permalink

Are you refering to the InputBox() VBScript function you're calling? If yes, then this is not related to BarTender's data entry form.

Have you already try to use the btApp.VisibleWindows property? This property can be used since BT v9.10:

-------
'Declare a BarTender application variable
Dim btApp As BarTender.Application

'Create a new instance of BarTender variable
btApp = new BarTender.Application

'Set the BarTender application visible
[color="#FF0000"]btApp.VisibleWindows = BarTender.BtVisibleWindows.btNone[/color]

'End the BarTender process
btApp.Quit(BarTender.BtSaveOptions.btDoNotSaveChanges)
--------

If that doesn't help, you might try to run the underlying BT process as a service (if possible) or just rewrite your VBScript code so that you don't have a need to show the "InputBox" VBScript method.
0
Avatar
Legacy Poster
Comment actions Permalink

Thank you for your help.

Y already try to use the btApp.VisibleWindows property without any success but with a different syntax.
With your syntax the result is the same.

Y solve my problem with rewritting the VbScipt, like as suggested, in the Bartender model.


Michel

Please sign in to leave a comment.