Hello, Igor!
About your 2) note: The 2.000 records (just field of names) in the combobox appears in alphabetical order and the user can type J and the combobox shows the first names starting with J. The user can continue typing, for example, Jo, and the combobox shows names starting with Jo...
Mike:
Setting ListIndex=0 for the Combobox did not work for the highlighted in blue, above.
In the area highlighted in red, I already use a clean button to deselect eventual selecting if the user click the down arrow of the Combobox/es and want to give up selection/s.
Mike and Paul:
In the...
Hello colleagues!
In my form (bellow) I give the user the option to select a name from a table (names are showed in alphabetical order).
The user can filter the result of the report by a chosen name, or he/she can leave it blank. I achieved this by appending a blank record to the table.
For...
I have just put this in the textbox QualPDEmissao, Valid event: (and nothing in the LostFocus event)
IF EMPTY(this.Value) OR this.Value>thisform.QualUDEmissao.Value
this.BackColor = RGB(255, 128, 128)
RETURN .F. && This stops the cursor from moving to the next field
ELSE...
Solved, following your advices:
I put in the Valid event:
IF EMPTY(This.Value)
this.BackColor = RGB(255, 128, 128)
RETURN .F. && This stops the cursor from moving to the next field
ELSE
this.BackColor = RGB(255, 255, 255) && Reset to default color if valid
RETURN .T.
ENDIF...
SoftwareRT: I put your provided code in the LostFocus event and the result was the same: the mouse cursor went to the next field.
Martinkk: I put the code in the Valid event only and this was the result:
Hello, colleagues!
I created a form, which has a field for date, which must not be blank: the user must type a date.
If the field for the date LostFocus and is blank the field becomes red and the cursor have to stay in the field (please see bellow).
But when I run it, if I leave the field...
Great, Mark! It works now!
I have never used the command IIF. I will dive into it now, to understand how to used it, and when to used it.
I have already seen examples using it (IIF) but have never paid attention to it. It is a powerful command.
Many thanks!
Hello, Mark.
NOMECIA and NOMENAV are fields in the Cursor curReservas.
XQualCia and XQualNav are variables that keeps options.
For example, if I left a combobox without choosing a company, XQualCia will be equal to "".
I think that if choose "NORWEGIAN", only records which has NORWEGIAN in...
Following Pieter suggestion, I tested this:
SELECT LOCALIZA, EMISSAO, CODAGENTE, NOMAGENTE, NOMECIA, NOMENAV, DATASAIDA, DOCUMENTO FROM RESERVAS WHERE ;
(EMISSAO>=XQualPDEmissao AND EMISSAO<=XQualUDEmissao) AND ;
(XQualCia="" OR XQualCia=ALLTRIM(NOMECIA)) AND ;
(XQualNav="" OR...
Well, it worked this way:
RowAtiva=thisform.Grid1.ActiveRow && Record position in the Grid
RowRelativa=thisform.Grid1.RelativeRow && Showed visible position in the Grid
IF (RowAtiva-RowRelativa)>0
FOR AVANCAR=1 TO (RowAtiva-RowRelativa)
thisform.Grid1.DoScroll(0)
NEXT...
Mike is correct,
SET FILTER TO <your filter condition here> IN curReservas
indeed woks fine!
I had said in my above post "... sometimes it does not work" just because, after applying the filter, some lines in the Grid became invisible! If I scroll up the grid all (correctly filtered) rows...
Thanks, Mike, I got what I needed, with your help:
SET FILTER TO (EMISSAO>=XQualPDEmissao AND EMISSAO<=XQualUDEmissao) IN curReservas
I have to insert more options in the filter and I think there will be no problem.
Why is it more efficient to regenerate the cursor? (SELECT... FROM table ...
Hello colleagues!
I have this form, with data in a Grid, with this command:
SELECT LOCALIZA, EMISSAO, CODAGENTE, NOMAGENTE, NOMECIA, NOMENAV, DATASAIDA, DOCUMENTO FROM RESERVAS;
WHERE (EMISSAO>=XQualPDEmissao AND EMISSAO<=XQualUDEmissao) INTO CURSOR curReservas
So, the data in the Grid...
Mark: Thanks for advise me! Yes, it would be a great mess. So before SEEK I have to insert SET EXACT = ON. Is it correct?
Doug and Mark: About READWRITE, I will not be using it in this Grid, because I am using is just for displaying data. If I click on any of the 5 indexed headers on the Grid...
Doug:
In my program (PRG) that calls the Form (with the Grid presenting the fields), I put this code and it worked fine:
SELECT LOCALIZA, EMISSAO, CODAGENTE, NOMAGENTE, NOMECIA, NOMENAV, DATASAIDA, DOCUMENTO FROM RESERVAS;
WHERE (EMISSAO>=XQualPDEmissao AND EMISSAO<=XQualUDEmissao) INTO...
A problem has arisen:
I have these commands in the colums, headers, for each time the user click on a header, the records are sorted in ascending order.
For example, in the column for the header of LOCALIZA field, I have the comands, in the Click event:
SET ORDER TO LOCALIZA
thisform.Refresh...
I agree totally with you, Joe. I also prefer to have the files in a program (PRG), select the records and fields I will use in a form or report, and save then in a Cursor, as I did in the form I am working now:
SELECT LOCALIZA, EMISSAO, CODAGENTE, NOMAGENTE, NOMECIA, NOMENAV, DATASAIDA...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.