MS access 2013 add records in form if null - ms-access-2013

In a form I have two fields f1 which is select menu (combo box) and another f2 which is text box.
How to set ms access when it write a record to check if f1 is not null to get and it, if f1 is null to write the text from f2.
something like that isnull(f1,f2).
After that to insert the text from f2 to table where are listed values from f1.

Related

How to get index of the cell value in UiPath

I am trying to get the index of the cell value in an excel sheet using Uipath.
I have tried using Lookup range inside Excel application scope but its giving up the first similar value found in the Sheet as having duplicate values as well.
Please Suggest how we can find the the exact index Of the cell.
I have used
LookUp Range activity
Read Cell Formula
Col1 Col2 Col3
DB AB BB
AC DB AN
AK AB AC
I need to find the IndexOf value DB , located at Col2 2nd row
I would use a For-Each item in DB activity.
You can iterate through the lines and access the value with item(0).toString e.g⠀
Then you can go on and check up the location of your searched text.
If you run a counter with it, you can easy detecting the Row and Col number of your searched field.
If you want to lookup in column B alone then you can set range as "B:B" in the Lookup Range Activity.
It will search the value in Column B and give you the index found in the 2nd column.
enter image description here
1.Read the Excel it will stored in DAtatable DT
2.Use for each row in datatable
3.Use if condition inside the loop
currentrow(1).tostring. Contains(“DB”)
4.Take Assign activity
Var_Index(int Datatype) = DT.Rows.indexof(currentrow)
Its may be work….

Pre Populate Text Fields in Apex

I'm trying to fill out various text fields on an apex application when I select a Reference Number in a select list.
When the page loads I'd like the text fields to be filled with the information from the database related to the reference number from the select list, however, I don't know how to do so. Any suggestions or help would be most appreciated!
As far as I understood the question:
user opens a page
there's a Select List item
user picks a value
you want to populate certain items on that page, based on a value user previously selected
If that's so, you'd use a dynamic action - create it on the Select List item, pick set value type.
[EDIT: How to do that?]
Scott's schema, DEPT table. Suppose that the select list item is P15_DEPTNO, while two other items are P15_LOC and P15_DNAME.
create a dynamic action on P15_DEPTNO
event: change
item: P15_DEPTNO
create its True action:
action: set value
type: SQL statement
select loc, dname
from dept
where deptno = :P15_DEPTNO
items to submit: P15_DEPTNO
affected elements: items P15_LOC, P15_DNAME
That's all.

How to write the query for interactive grid based on the select list in Oracle Apex

I have a drop down select list (P2_ROLE). I want to generate the interactive grid based on the value that I select from the drop down.
I am trying to do that but the query is not returning any result in the grid. However, if I query it in the database, it returns me the result.
It looks like that it is not substituting the value from the dropdown into the IG query. But If I hard code the value, it gives me the results.
dropdown_IG issue
I also tried returning the value selected from the dropdown in the item : P2_SELECT_LIST_VALUE and then using it in the query. But it also doesn't work.
The query that I have used for my Interactive grid is :
Select USER_NAME
From WF_USER_ROLES
Where ROLE_NAME = :P2_SELECT_LIST_VALUE ; --using the value from new item
or
Select USER_NAME
From WF_USER_ROLES
Where ROLE_NAME = :P2_ROLE; -- using the value directly from Dropdown
After selecting the value in the dropdown, I am refreshing the IG region using dynamic action on change select list. But that also doesn't help. How can I do that ?
Select list returns two values: display and return. Its form is, for example,
select dname disp_val,
deptno ret_val
from dept;
Its return value is then used in interactive grid's query.
Also, in order to be able to use select list's value, it has to be stored in session state; if it is not, query won't work. The simplest option is to submit the page, and you can do that by setting that item's Page action on selection property to "Submit page". Doing so, your IG query:
Select USER_NAME
From WF_USER_ROLES
Where ROLE_NAME = :P2_ROLE
should work OK. If it still does not, create an example on apex.oracle.com, provide credentials so that we could have a look at what you did.

Apex 5.0 : Action on buttons ? Get value from textfield?

The first problem is that I have a button. I created a process called nextweek( to get data for next week from reservation table). I tried this The PL/SQL only as a trial:
begin
if :RESERVNO is null then
select RESERVNO
into :RESERVNO
from reservation;
end if;
end;
but the page keeps telling me "NO DATA FOUND". I would like to create a report with the result of my PL/SQL Query
My second problem is that I want to take values from a textfield and use it in my PL/SQL Query in another button as the "ACCEPT" in oracle.
As I understand, you need following:
Create report: click Create new page button (or create region if you already have a page), then choose region type Report. Write your source SQL query in the field Region source (choose Source type - SQL Query).
Create an item (textfield). For example, with the name P_MY_ITEM
Create a button. Here you don't need to change default properties. (Action on button click should be Submit page)
Add this item name to the source query in the region. It should look like:
select column1, column2, column3
from table1, table2, table3
where column4 = :P_MY_ITEM
and <other conditions>
After that, user can write something to the input field and press the button, page will be reloaded, and report will be changed accordingly to the item value.

CheckBox in Oracle Forms

I have a Database block contains 3 columns. in that all are character columns.
I have created a multi record block in a form which contains 2 text item and one check box.
The values in the table are like below
col1 col2 col3
value1 value2 N
Value3 value4 N
Value5 value6 Y
In the form, I want to find only the records with Value 'N' in the col3.
I want to find the values using Enter - Query, Execute Query method, But here in my form, col3 is the checkbox. if ticked -Y, not ticked value will be 'N'.
I know, we cannot search 'N' values using Enter - Query, Execute Query method.
Is there Any other way we can search?
Your problem is that in enter-query standard functionality is that the checkbox contains an empty value (null) and is not unchecked. To search for an unchecked value just go in enter-query mode and click the checkbox to have the "Y" value in your case and click it again to have the "N" value. From now on you can check and uncheck the value.
If you have made a mistake and want it to be empty again use the clear item key to set it back to null.
If you want to allow querying the block based on the checkbox, you need to have the checkbox values stored somewhere, probably in a Y/N column on the table that the block is based on.
Before the block is queried, you'd just need to ensure the checkbox values are posted to the database.
If you can't save them to the table itself, an alternative would be to save them somewhere else, but it has to be something accessible to the query itself - e.g. a global temporary table.
Why not use the check box to enter the needed search criteria form col3? I can't see why that should not be possible and I even tested it quickly. Please try the following
Set properties of your checkbox for col3 as follows
Value when Checked = Y
Value when Unchecked = N
Check Box Mapping of Other Values = Not Allowed
Initial Value = N or Y whatever suites your business need
Database Item = Yes
Column Name = col3
If using this kind of settings you can in Enter Query mode select if you want the query for col3 = N by making sure that the check box is unchecked when executing the query.

Resources