************************************
*PROCEDURE text4.LostFocus IS WHERE i GET LOST
**********************
PUBLIC oform1
oform1=NEWOBJECT("form1")
oform1.Show
RETURN
**************************************************
*-- Form: form1 (q:\pncommadvice\pnadvice.scx)
*-- ParentClass: form
*-- BaseClass: form
*-- Time Stamp: 04/20/10 11:11:08 AM
*
DEFINE CLASS form1 AS form
Height = 470
Width = 1047
DoCreate = .T.
AutoCenter = .T.
Caption = "Form1"
WindowState = 0
BackColor = RGB(255,156,108)
Name = "Form1"
ADD OBJECT label1 AS label WITH ;
FontBold = .T., ;
FontSize = 11, ;
BackStyle = 0, ;
Caption = "TO PUT ADVICE NUMBERS INTO 'SLSPNPAY.DBF'", ;
Height = 24, ;
Left = 50, ;
Top = 24, ;
Width = 396, ;
TabIndex = 7, ;
Name = "Label1"
ADD OBJECT command2 AS commandbutton WITH ;
Top = 192, ;
Left = 384, ;
Height = 37, ;
Width = 49, ;
FontBold = .T., ;
Picture = "..\close.bmp", ;
Caption = "EXIT", ;
TabIndex = 6, ;
Name = "Command2"
ADD OBJECT line1 AS line WITH ;
Height = 228, ;
Left = 36, ;
Top = 12, ;
Width = 0, ;
Name = "Line1"
ADD OBJECT line4 AS line WITH ;
Height = 0, ;
Left = 38, ;
Top = 12, ;
Width = 442, ;
Name = "Line4"
ADD OBJECT text1 AS textbox WITH ;
FontBold = .T., ;
FontSize = 10, ;
Value = "", ;
ControlSource = "LCADVICE", ;
Format = "R", ;
Height = 32, ;
InputMask = "", ;
Left = 192, ;
TabIndex = 1, ;
Top = 85, ;
Width = 109, ;
Name = "Text1"
ADD OBJECT label2 AS label WITH ;
FontBold = .T., ;
FontSize = 10, ;
BackStyle = 0, ;
Caption = "ENTER FIRST ADVICE NUMBER", ;
Height = 25, ;
Left = 149, ;
Top = 61, ;
Width = 204, ;
TabIndex = 8, ;
Name = "Label2"
ADD OBJECT label3 AS label WITH ;
FontBold = .T., ;
FontSize = 10, ;
BackStyle = 0, ;
Caption = "CHECK DATE", ;
Height = 25, ;
Left = 204, ;
Top = 151, ;
Width = 84, ;
TabIndex = 9, ;
Name = "Label3"
ADD OBJECT text2 AS textbox WITH ;
Alignment = 3, ;
Value = {}, ;
ControlSource = "ldpayckdate", ;
Format = "", ;
Height = 32, ;
InputMask = "", ;
Left = 192, ;
TabIndex = 2, ;
Top = 184, ;
Width = 109, ;
Name = "Text2"
ADD OBJECT line5 AS line WITH ;
Height = 0, ;
Left = 36, ;
Top = 240, ;
Width = 444, ;
Name = "Line5"
ADD OBJECT line2 AS line WITH ;
Height = 228, ;
Left = 480, ;
Top = 12, ;
Width = 0, ;
Name = "Line2"
ADD OBJECT text3 AS textbox WITH ;
Value = "", ;
ControlSource = "lcsearch", ;
Format = "R", ;
Height = 25, ;
InputMask = "#########", ;
Left = 151, ;
TabIndex = 4, ;
Top = 312, ;
Width = 109, ;
Name = "Text3"
ADD OBJECT label4 AS label WITH ;
FontBold = .T., ;
FontSize = 10, ;
BackStyle = 0, ;
Caption = "TO SEARCH...ENTER ACCOUNT NUMBER AND REG NUMBER", ;
Height = 25, ;
Left = 59, ;
Top = 264, ;
Width = 384, ;
Name = "Label4"
ADD OBJECT list1 AS listbox WITH ;
BoundColumn = 2, ;
ColumnCount = 5, ;
ColumnWidths = "54,93,25,81,60", ;
RowSourceType = 6, ;
RowSource = "slspnpay.payreg,payacct,payfreests,payckno,payckdt", ;
FirstElement = 1, ;
Height = 446, ;
Left = 516, ;
NumberOfElements = 0, ;
SpecialEffect = 1, ;
TabIndex = 3, ;
Top = 12, ;
Width = 469, ;
Name = "List1"
ADD OBJECT text4 AS textbox WITH ;
Alignment = 3, ;
Value = 0, ;
ControlSource = "lnreg", ;
Format = "R", ;
Height = 25, ;
InputMask = "####", ;
Left = 283, ;
TabIndex = 5, ;
Top = 312, ;
Width = 73, ;
Name = "Text4"
PROCEDURE command2.Click
CLOSE ALL
CLEAR EVENTS
QUIT
ENDPROC
PROCEDURE list1.DblClick
REPLACE SLSPNPAY.PAYFREESTS WITH 'D'
REPLACE SLSPNPAY.PAYCKNO WITH 'DD'+PADL(ALLTRIM(LCADVICE), 8, '0')
REPLACE SLSPNPAY.PAYCKDT WITH LDPAYCKDATE
SET DECIMALS TO 0
LCADVICE=VAL(LCADVICE)+1
LCADVICE=TRANSFORM(LCADVICE)
THISFORM.Refresh
ENDPROC
PROCEDURE text4.LostFocus
LOCATE FOR slspnpay.PAYACCT=LCSEARCH AND slspnpay.PAYREG=LNREG
ENDPROC
ENDDEFINE
*
*-- EndDefine: form1
**************************************************
Post by Rush StrongNot to be snide, but we need more "specific and detailed" info about
your code.
Have you used the Class Browser to view your form as code? If so,
please copy and post the sections relating to your controls. If
you're not familiar with the Class Browser, then learn it! It is a
very useful tool.
- Open the Class Browser from the Tools menu;
- Use the "File Open" icon to Open your form (select "Form" under
the "Files of type");
- Click the "View class code" button;
- Copy and paste.
[Note: the code you view may be able to create a simple form, but it
will fail for most cases. It is intended only for review, though it
can be modified to run. If you want to properly appreciate the GUI,
consider that this is how you'd create a form from code.]
- Rush
Post by sherryLet's try something different.
I have 2 txt boxes, on lost focus of #2 I want to do a locate for the info
in the 2 boxes. This sort of works. I locates the record in the table, but
the listbox doesn't go to that record. I know my coding is wrong but don't
know what to put.
Thanks
Help need to be specific and detailed please.
Sherry
Post by Rush StrongPost by sherrycan a search be done on a listbox control?
Does the IncrementalSearch help?
- Rush
.
.