Function IIF and SENDKEYS in a query (1 Viewer)

Leo_Polla_Psemata

Registered User.
Local time
Today, 04:00
Joined
Mar 24, 2014
Messages
364
A: iff(SOMETHING, THIS, SENDKEYS CTR+" )

Hi, could one query field, which is structured as above, work ?
My need is to fill all blank cells in a query, then i append all records to a table.

In Access we can copy paste the record above with ctrl "
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 19:00
Joined
May 7, 2009
Messages
19,169
you can't do that.
what you can do is create a Function that will
fill a Column of missing data.
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 19:00
Joined
May 7, 2009
Messages
19,169
see Table1, there are missing Values on either Field1 or Field2.
run Query1 and see those values are "filled" in from previous recordd.
 

Attachments

  • Sampol.accdb
    424 KB · Views: 302

Leo_Polla_Psemata

Registered User.
Local time
Today, 04:00
Joined
Mar 24, 2014
Messages
364
Hi, now i need a function which will tell if the field in id line 10 is same as id line 9, if same we mark as 1 in not same we mark as 2.

In excel the formula would be made very easily - at cell B2 - "=IF(A2=A1,1,2)"
Can we make a function in access as above that will tell if id 1 is same as id 2 ?

What i am trying to achieve, there is a large text message in standard layout, which i use several string functions and convert it to spreadsheet.
I receive this two or three times each week. Currently i shape data in excel, then i copy paste excel in access and bam, i get my spreadsheet plus several other reports.
 

Leo_Polla_Psemata

Registered User.
Local time
Today, 04:00
Joined
Mar 24, 2014
Messages
364
see Table1, there are missing Values on either Field1 or Field2.
run Query1 and see those values are "filled" in from previous recordd.

Hi arnelgp,
now i need a function which will tell if the field in id line 10 is same as id line 9, if same we mark as 1 in not same we mark as 2.

In excel the formula would be made very easily - at cell B2 - "=IF(A2=A1,1,2)"
Can we make a function in access as above that will tell if id 1 is same as id 2 ?

What i am trying to achieve, there is a large text message in standard layout, which i use several string functions and convert it to spreadsheet.
I receive this two or three times each week. Currently i shape data in excel, then i copy paste excel in access and bam, i get my spreadsheet plus several other reports.
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 19:00
Joined
May 7, 2009
Messages
19,169
post a sample xlsx raw data and the expected result on the other sheet.
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 19:00
Joined
May 7, 2009
Messages
19,169
on the Sampol db i posted, create new Query.
do not select any table, instead paste this
in SQL View:

SELECT Table1.Field1, IIf((select TOP 1 field1 from table1 T where T.ID < Table1.ID ORDER BY ID DESC)=[Table1].[Field1],1,2) AS Expr1
FROM Table1;
 

Leo_Polla_Psemata

Registered User.
Local time
Today, 04:00
Joined
Mar 24, 2014
Messages
364
Hi, I am trying to attach an xlsx file but the "attach file" button doesn't see any xlsx format files ??!!
 

Leo_Polla_Psemata

Registered User.
Local time
Today, 04:00
Joined
Mar 24, 2014
Messages
364
No need, now i have got it with this "
SELECT Table1.Field1, IIf((select TOP 1 field1 from table1 T where T.ID < Table1.ID ORDER BY ID DESC)=[Table1].[Field1],1,2) AS Expr1
FROM Table1; "

I am deeply grateful, i don't know how could i ever return this to You ....
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 19:00
Joined
May 7, 2009
Messages
19,169
goodluck, comeback if something came up.
 

Users who are viewing this thread

Top Bottom