Topics Search

Using Table Field In Like Function

Using Table Field In Like Function
Views: 3
I have a table that contains a field with a unique identifier. I need to search another table that has a comment field which could contain the unique identifier somewhere within it. I thought I could use the LIKE function and embed the unique identier field name withing the syntax of the like function, but I can't get it to work. I've tried Like "*[unique identifier]*", but it seems to be looking at it as a string so I get no results
Sponsored Links:

More topics


Storing Functions in a Table

What I am trying to do is to store a function call in a table field (identified as text), and then try to run that function in a query. I need to know how to tell the query to run the function, instead of just returning the text of the function.
Table 1:
Field Name Field Contents
Fields: Product_ID = 68500
Fields: Products_Function = fp([some date from another table], 1)

So when I use the [Products_Function] field in a query it just returns the text contents. I want it to run the function.
MS Access 2003 SP

Linked table query

I have two tables linked where Table A, field 1, is a look up table for Table B in Field 1.
Table A has 3 fields and I want to query Table B based criteria in Table A, field 2 and 3. SQL as follows

SELECT [Table A].[Field 2], [Table B].[Field 2], Sum([Table B].[Field 2]) AS [SumOfField 2]
FROM [Table A] INNER JOIN [Table B] ON [Table A].[Field 1] = [Table B].[Field 1]
GROUP BY [Table A].[Field 2];

I keep getting the error "You tried to execute a query that does not include the specified expression <Table B Field 2> as part of an aggregate function. (Error

Search function that only looks through one field in a table

I'm having trouble figuring out if it is possible to limit the access search function to only one field in a table.

I am working on a database that with one main table, and several form which have record sets using this table (bound). but there is one rather large problem: The table of records they want to search through has over 130 fields (I know, the DB itself was built before I began trying to improveit) When searching for a record, the only applicable field used is [Address], though the preconstructed Access search feature looks through the whole table.which takes a long time with 130fields X 50,000 records.

Can I build a function that searches through only the Address field in the bound table?

How to call a function from aMake table query

I am pretty new at this and have LOTS to learn.

Have a Make table query and don't seem to have correct coding that calls a function and places funtion result into specified table field

VBA coding (simplified):

private function Create_Week_Num () Week_Num as String
do something
end function

The VBA coding is in a lib named: Work1 Module1

Query field:

Default values in Access 2000

I am trying to assign a default value to a field in an Access table. The default value is generated in a function which is declared as PUBLIC in a module.

When trying to assign this function as the default value to a field in a table in the same db, Access does not recognize the function.

However in a query or in a form I can reference and call the function without any problem.

Function to select field from a table using several criteria

I am new to VBA and need help creating a function to select data from a table in the current database. I would like the function to accept parameters (fieldname, tablename, one or more criteria). I would call the function from any other procedure or from a query field. I am using Access 2007 in the XP.

I would call the function as in this example:

MyFunction("fieldname","tblTableName","criteria1 = 5 and criteria2 = 45")

It would be nice if it accepted numeric as well as strings in the criteria

VBA Access function

I need a function to do:

- Loop through all fields in a table (use tabledef) (use any table tablename should be a parameter for the function)

- There needs to be a timestamp-field which is set on some records and not on others

- For each textfield (only textfields ignore all others!) check if there are new values (compared between the ones with time-stamp and without ) without time stamp will be first default entry and with time stamps will be updated entry

- If there are new values add the name of the field and the new values to a log-table

- After looping through all textfields and putting the name of the field and the values into the log-table export the log table to Excel and show it in Excel. (alternatively you can log directly to Excel)

The end result in Excel should look something like this:



search for key word in field

I have a table (t_Marketing List). In this table I have a field for "Item Title". I want to be able to do similar to what I did with this database in Excel with the ctrl+f function where Ican type in a word or series of words and search the Item Title field for anything that matches.

I have created a form with an unbound text box (txtSearch) and linked that to the Item Title field in my subform from my table (t_Marketing List).

I can't seem to get it to function properly. Is there any way to get this search box to function as I had hoped? (similar to the ctrl+f or like a google search)

Populating a field from another table using DLookup

I'm trying to populate a field (we'll call it field#2) on a standard form (Customer Record Card) automatically after I've selected the contents of another field on the same form (we'll call it field#1)

The content of field#1 is a pick-list lookup from a separate table. The other table also holds the look-up list I want to use to populate field#2. The relationship between fileds 1 & 2 is direct. Sounds simple ? It's driving me nuts.

I've tried using DLookup and I'm stuggling.

Can it be done using DLookup or another Built-in function or do I need more complex code.

Can anyone tell me what the syntax for the Dlookup function in the above scenario would be . and where should I put it ? "on click" "after update


I want a field in my table to list the name of the person who created the record. I've been trying to do this using the fOSUsername function, by copying and pasting that code into a module and then setting the default value of the field to =fOSUsername(). But, this isn't working because I get an error that the function is unknown when I try to save the table. I've spent ages trawling forums looking for an answer but can't make it work.

Can anyone help me, possibly by posting a sample database with the module and a table that has a default value based upon calling the function? I think from that I'd be able to make it work in my own database.