Thanks Skip
This is the test Macro I'm using:
Declare Function DisplayChoice(ioutput%, szWCNum$, szHouseNum$, szStrNam$, szBuildNam$, szCABNum$, _
szLPANum$, szHPANum$, szserterm$) As String
Sub Main
Dim szWCNum$, szHouseNum$, szStrNam$, szBuildNam$, szCABNum$, szLPANum$, szHPANum$ , szserterm$
Dim ioutput%
Dim iDone%
Dim szAPPL as String
Begin Dialog dlgIMSENT 200, 100, 300, 250, "Information for CLEC"
ButtonGroup .ButtonPressed
OkButton 100, 200, 50, 14, .cmdOK
CancelButton 180, 200, 50, 14, .cmdCancel
OptionGroup .ogoutput
OptionButton 10, 40, 63, 10, "ADD FALP(2 wire)", .btnADDFA2
OptionButton 10, 60, 63, 10, "ADD FALP(4 wire)", .btnADDFA4
OptionButton 10, 80, 63, 10, "RMV FA(2 wire)", .btnREMFA2
OptionButton 10, 100, 63, 10, "RMV FA(4 wire)", .btnREMFA4
OptionButton 10, 120, 63, 10, "CHANGE FA", .btnCHANGE
Text 120, 20, 61, 20, "Wire Center: (2 Characters)"
Textbox 200, 20, 80, 10, .tbxWCNum
Text 120, 40, 61, 20, "House Number: (up to 13 Characters)"
Textbox 200, 40, 80, 10, .tbxHouseNum
Text 120, 60, 61, 20, "Street: (up to 50 Characters)"
Textbox 200, 60, 80, 10, .tbxStrNam
Text 120, 80, 61, 20, "Buliding: (5 Characters)"
Textbox 200, 80, 80, 10, .tbxBuildNam
Text 120, 100, 61, 20, "Cable Number: (5 Characters)"
Textbox 200, 100, 80, 10, .tbxCABNum
Text 120, 120, 61, 20, "Low Pair: (2 Characters)"
Textbox 200, 120, 80, 10, .tbxLPANum
Text 120, 140, 61, 20, "High Pair: (2 Characters)"
Textbox 200, 140, 80, 10, .tbxHPANum
Text 120, 160, 61, 20, "Serving Term: (up to 50 Characters)"
Textbox 200, 160, 80, 10, .tbxserterm
Text 10, 20, 100, 9, "Select Transaction:."
End Dialog
iDone = FALSE
While (iDone = FALSE)
Dim dMain as dlgIMSENT
nRet = Dialog(dMain)
Dim iResponse As Integer
Dim dlg As dlgIMSENT
iResponse = Dialog(dMain)
Select Case nRet
Case -1 ' -1 is returned if the user chose OK
iDone = TRUE
ioutput = dMain.ogoutput
szWCNum = dMain.tbxWCNum
szHouseNum = dMain.tbxHouseNum
szStrNam = dMain.tbxStrNam
szBuildNam = dMain.tbxBuildNam
szCABNum = dMain.tbxCABNum
szLPANum = dMain.tbxLPANum
szHPANum = dMain.tbxHPANum
szserterm = dMain.tbxserterm
szAPPL = DisplayChoice(ioutput, szWCNum, szHouseNum, szStrNam, szBuildNam, szCABNum, _
szLPANum, szHPANum, szserterm)
' msgbox (szAPPL)
Case 0 ' 0 is returned if the user chose Cancel
iDone = TRUE
Case 1 ' 1 is returned if the user chose Reset
dMain.ogoutput = 0
Case Else
msgbox "Some undefined button pressed " + str(dMain.ButtonPressed)
End Select
Wend
End Sub
Function DisplayChoice(ioutput%, szWCNum$, szHouseNum$, szStrNam$, szBuildNam$, szCABNum$, _
szLPANum$, szHPANum$, szserterm$) As String
Dim szIMSENT$
' -------------------------------------
Select Case ioutput
Case 0
Msgbox "Add FALP 2 wire"
j = szLPANum
Do
If j > szHPANum Then
Msgbox j
Exit DO
Else
j = j +1
Msgbox j
End if
Loop
Msgbox j
Case 1
Msgbox "Add FALP 4 wire"
Msgbox szLPANum
Msgbox szHPANum
j = szLPANum
Do
If j > szHPANum Then
Msgbox j
Exit DO
Else
k = j
Msgbox j
j = j +1
Msgbox j
j = j +1
Msgbox j
End if
Loop
Msgbox j
Case 2
Msgbox "REMOVE FALP 2 wire"
Case 3
Msgbox "REMOVE FALP 4 wire"
Case 4
Msgbox "CHANGE FALP "
End Select
' ------------------------------------
End Function