allow gridlookupedit control to search only after typing two characters - vb.net

I am using third party tool "gridlookupedit" of DevXpress in my application. I have loaded the gridlookupedit control on the key Down event of it. Now if i type a character "A" the dropdown gets loaded with all values starting with "A". Now a step ahead i want to load the GridLookUpEdit only after two characters.
for rg: the control must load values only when user types any two characters. If user types "A" it should not load. if user types "Ab" then the control should be loaded by the values starting with "Ab".
how can i do this?

On your Key Down event I guess you've got some code that populates gridlookupedit? If so just put a if around your code to only update if the length is grater than 1
If gridlookupedit.Length > 1 Then
' Update List
End If

Related

How to write correct field criteria to get rid of the 'enter parameter value' erro?

PICTURE OF QUERY :
I'm plotting graphs for 10 machines (machine 1, machine 2,...) performance -
average vs date graph.
User shall select the machine from a combobox (i made the values obtained from query, or should I make it from the table?) and set it to contain unique values only.
After selecting the machine, user shall click OK button. and a graph of the selected machine should be displayed in a new form.
Problem is, every time I click OK, it prompts me with the ENTER PARAMETER VALUE Forms!ViewReport!Combo9.
After I enter "machine 1" in the ENTER PARAMETER VALUE, it displays the graph correctly. I am expecting the graph to be displayed directly without the error.
The dialog appears because the query has no access to the field Combo9. Probably your form is not open or ViewReport is a subform, in this case, the reference to Combo9 should be different. Check, for instance, this giude for controls references.
But the most reliable method is to create a public function in the standard module, which should return the value from the desired form's field. It can check if the form is open and return the default value if the form is not available or the value is not selected. This function can be used in queries as criteria or in calculated fields.

Listbox error "Entry is too long for the field"

After selecting a value in a dropdown listbox field, there is this error message:
Entry is too long for the field
(it's the message number 00092)
I created one text field TXTOPENV as Listbox with key value, set value using VRM_SET_VALUES in PBO section.
Here is the screenshot of screen painter:
Screen flow logic:
PROCESS BEFORE OUTPUT.
MODULE status_0210.
ABAP code:
DATA txtopenv TYPE c LENGTH 1.
MODULE status_0210 OUTPUT.
SET PF-STATUS 'ST210'.
SET TITLEBAR 'T210'.
PERFORM GetVacancy.
ENDMODULE.
FORM GetVacancy.
TYPES: BEGIN OF ty_vacancy,
plans TYPE t528t-plans,
plstx TYPE t528t-plstx,
END OF ty_vacancy.
DATA: wa_vacancy TYPE ty_vacancy.
LOOP AT it_vacancyid INTO wa_vacancyid.
SELECT plans plstx
FROM t528t
INTO wa_vacancy
WHERE plans = wa_vacancyid-ty_objid.
ENDSELECT.
field_id = wa_vacancy-ty_plans.
value = wa_vacancy-ty_plstx.
APPEND value TO values.
CLEAR wa_vacancy.
ENDLOOP.
CALL FUNCTION 'VRM_SET_VALUES'
EXPORTING
id = 'TXTOPENV'
values = values
EXCEPTIONS
id_illegal_name = 1
OTHERS = 2.
ENDFORM.
The error "Entry is too long for the field" is not specifically related to the listbox fields, but may occur with all types of screen fields, so I will first answer the general case, and then explain why you were mistaken .
The error happens when the screen field is defined with a "definition length" which is larger than the length defined for the eponym global variable in the ABAP program (eponym: the name has to be the same so that to allow the transfer of values between screen and program, back and forth), and when the input value is larger than the length of the ABAP program.
In your case, the key of the selected value in the listbox is probably larger than 1 character which is the length of the global variable.
The solution in your case is to set the variable to 8 characters:
DATA txtopenv TYPE t528t-plstx.
NB:
In your screenshot of the listbox field with possible values, only the texts are shown, but you can also display the key value via SAP GUI settings Interaction Design > Visualization 1 > Show keys within dropdown lists.

Number Picker in Access / VBA

I am trying to put a number picker in a form in MS Access 2007. Here's an example of what I am trying to make:
I cannot find this in the default form controls, and have tried to make one myself using a listbox. Listboxes can be modified to look just like the number picker above, however the arrows only change the view, of the list, and not the actual selection (that is the value). For example, with the list box, if I have it range from 1 to 3, and default at 1 - when I change it to 2 via the arrows, the value of the listbox does not change, and is still one.
Does anyone know how to get a number picker in Access?
So you want to create a list of numbers and allow users to change the value displayed (AND stored as the control's value) using up and down arrows, such that they select the next or previous in the list.
I would suggest creating a text box and two buttons. Populate an array with the list of values. When a button is clicked it would:
A. Find the position in the array of any value already entered into the text box (eg loaded from a database)
B. Get the next or previous item from the array.
The array is populated as required (probably when the form is opened).
If you just need to allow the user to enter a whole integer number (ie a number spinner) you would do as follows:
Create one using a (locked) textbox and two buttons. Just add a textbox (name it something like txtValue) and two buttons (btnUp and btnDown), then add code like this to the Click event of those buttons:
Private Sub btnUp_Click()
Me.txtValue = Nz(Me.txtValue, 0) + 1
End Sub
Private Sub btnDown_Click()
Me.txtValue = Nz(Me.txtValue, 0) - 1
End Sub
You could add if statements to limit the data being entered
Or you can use a 3rd party control.
http://www.fmsinc.com/microsoftaccess/controls/components/spin-button/index.html
There are probably more, but be aware that using these sorts of controls in Access is unsupported, and there is no guarantee moving forward that they will work in Access. You're far better off using the native methods described earlier.

How to get dynamic created table's total column and row using Request.Form in vb.net

I am doing my project in Vb.net using MVC 4.0
I have created dynamic table and in that textboxes in td using javascript and now i want to get that table's total row and column as well for further process in Controller function.
How I can get using above using VB.net?
I have used Request.Form but the id of the textboxes in table is created uniquely so first I want to find the total column and row so based on that I can move further and check using for loop.
It seems like if you are generating your table through javascript you should also be able to set the value of a hidden field to the value you are outputting to your totals column. If you created a hidden field with the value set you should be able to access it from the Request collection. If it is not actually in a field that gets posted back you will only be able to access the value from the client-side.
document.getElementById("myInput").value = "Value you are outputting to your "total" cell
[Solved]
I got all the controls on code behind by it's name by using FormCollection just i need to do is post back the form using form action method because with using ajax i am not getting the formcollection in code behind but directly using form action method i can get all the controls name.
These are the textbox ids by which i can get the value just need to do further process like:
For Each _formvalues As String In formcol
formcol(_formvalues)
Next
fomcol is an object of FormCollection,_formvalues is used for moving one by one name coming in formcol and to take the data inside means name just write formcol(_formvalues) that's it.

How to change input fields disregard of mandatory fields?

I have a dynpro with several mandatory fields. Now, I want to implement a button that prefills those fields with suggested values. Further, another button should deactive certain input fields.
My problem is that the button actions are stopped by the empty mandatory fields. Is there a way to skip those validations, if a certain button has been pressend and acces the PAI - PBO handling?
You must execute your action before the mandatory checks bloc other changes.
Instead of
MODULE ... INPUT
you can try
MODULE ... AT EXIT-COMMAND
Normally the AT EXIT-COMMAND allows you to leave the screen, even if the values are missing. But you can use it also to fill mandatory fields.
After filling the mandatory field I would call again the screen to process PBO/PAI again. So the user can see the new changed values.
One question: Could you also fill the values during PBO?
Something like:
MODULE ... OUTPUT.
IF field is initial.
field = default_value.
ENDIF.