Capture Raw SQL Query String To Form

Aug 24, 2007

Hello everyone,

Simply put, I want to create a form to which I can enter a raw SQL statement (such as: SELECT * FROM contacts without having to create a new Access query.

The way i have tried to do this is by creating a form which uses an onclick function to pass the string variable (the query statement) to a sencond form and have the second form run the statement. I can pass the variable ok but I cant figure out how to the use the variable string in the second form to execute as the "Record Source" of the form.

Any ideas?

Thanks,
Curveo

View Replies


ADVERTISEMENT

Capture The Results Of A Filter By Form?

Apr 10, 2005

Not sure whether this really belongs in the Forms, or VBA or forum, picked Forms because I think it stems from that, despite probably involving VBA in the solution...

I'm getting used to using filter by form and find it quite useful for those off-the-cuff queries, however, it is possible to 'capture' the records so that the results of the filtering can be passed to a readymade report (so that they can be printed out in a more presentable manner than the table view)?
(To what would the Record Source of the report be set?)

Tim

View 1 Replies View Related

How Do I Capture User Info In A Form

Jan 22, 2006

:) Hi Guys,
I have a small problem, hope you can help me out. I have created a a form in Access for data entry. But I would like the form to capture the data and time and the user who's entering the data into the form.
How do I do that. Been trying to figure it out:rolleyes: . Hope you can help. Attached is the screenshot of the form I created. Thanks a bunch

http://img21.imageshack.us/img21/5612/screenshot4ic.th.jpg (http://img21.imageshack.us/my.php?image=screenshot4ic.jpg)

http://img21.imageshack.us/my.php?image=screenshot4ic.jpg

View 3 Replies View Related

Forms :: Possible To Capture Form Filter?

Oct 28, 2014

Is it possible to capture a form's filter? In Access 2013, I have a form (from a template database) listing contact information. I can set filters by clicking on the column headers and selecting which records I want displayed. There is also a button to run a mail merge with Word. I want the merge to only include those records displayed on the form at the time it's run.

View 1 Replies View Related

Can I Execute A Query And Capture Result?

Oct 21, 2005

I have a stored query in my db. The query gets the recordcount of all the items in a table.

In my VBA, rather than code a new db conection, set a recordset etc, I want to execute the query using DoCmd

=======
DoCmd.OpenQuery stDocName, acNormal, acEdit
=======

The above line displays the results of the query.

What I really want is to run the query and store the recordCount in a variable - without displaying the results.

Can this be done?

Thanks all

View 2 Replies View Related

Queries :: Incomplete Capture In Query

Jul 11, 2013

I have a query which exports to a excel file afterwards, however, it's not capturing all the data I need.My query is at the bottom, and I think the problem is the "(([tbl Master].ID)=[tblRequest].[Cost Centre]))" statement, as this means that it'll never pick up a Cost Centre starting with "Z", as they don't exist in [tbl Master] (they're exceptions to the rule basically).

What I need to do is only parse the statement "(([tbl Master].ID)=[tblRequest].[Cost Centre]))" if the Cost Centre doesn't start with "Z", if it does, then it'll find it in the table, as there's validation on the point of entry that don't start with it.

Code:

SELECT tblRequest.RequestID, 'N/A' AS [Week No], tblRequest.[Refund Date] AS [Date],
tblRequest.Requester, tblRequest.Authoriser, tblRequest.Refunder AS Processor,
tblRequest.[CRIS Reference] AS [CRIS Ref No], tblRequest.[Customer Title] & ' ' & [Customer Name] AS [Customer's Name],

[code]....

View 2 Replies View Related

Capture Username Who Added A Record In Form

Nov 29, 2005

I have a form where there are many users to enter or update data. I need to capture the username who created a record , then , on form load , I want system to check for username if it is same as the creator of a record , then allow update , otherwise don’t allow update , but allow only adding new records. How can I do this

View 3 Replies View Related

Queries :: Formula To Capture Filename In Query?

Jan 25, 2014

Need a formula which can capture filename for me. For example, I have a db saved at "C:DlocationofficeChina.accdb". Is there a way to capture "China" in a query?

View 2 Replies View Related

Queries :: How To Capture Data In A Field To Be Used In Query

Feb 12, 2015

How do I capture data in a field (one record) to be used in a query.I have a query with [Unit] as a criteria. I want to capture the unit info in a field then have it used in the query.

View 5 Replies View Related

Forms :: How To Capture SSN From First Form To Use As Focus For Second Form

Jul 22, 2013

I have two forms that have a unique field (SSN).As I'm working in one form, I want to be able to pull up the other form (which isn't a problem). On the second form pulled up, I want the record to match the first form (SSN) - this is the problem.

I believe SetFocus is what I need to use but I don't know how to capture the SSN from the first form to use as the focus for the second form.

View 4 Replies View Related

Forms :: Capture When Record Has Created And Data On A Form Changed

Mar 28, 2013

I need to know when:

* a new record has been created
* data on a record has been changed

Does the On Dirty event capture this, or can I just use the forms On Change event?

View 2 Replies View Related

String Found In *deleted* Query/form

Aug 20, 2007

I've created a function to search for a string in SQL definitions:
Public Sub SearchInQueryDefs(strSearch As String)

Dim qdf As QueryDef
Dim qdfs As QueryDefs
Dim blnFound As Boolean

Set qdfs = CurrentDb.QueryDefs

For Each qdf In qdfs
blnFound = InStr(1, qdf.SQL, strSearch) > 0
If blnFound Then
Debug.Print "Searching : " & qdf.Name & "...";
Debug.Print " - found"
If vbNo = MsgBox("Found!" & vbCrLf & vbCrLf & "" & strSearch & " found in "

& qdf.Name & vbCrLf & vbCrLf & qdf.SQL & "" & vbCrLf & vbCrLf & "Click 'Yeah' to

continue search, 'Duh' to stop", vbExclamation + vbYesNo, "SearchInQueryDefs") Then
Exit Sub
End If
End If
Next qdf

MsgBox "Done searching.", vbInformation, GetAppTitle()
End Sub

Using the following statement (in the immediate window) i get the following result:
SearchInQueryDefs "Queries"
Searching : ~sq_cfrmReports~sq_clstQueries... - found
However query "~sq_cfrmReports~sq_clstQueries" doesn't exist.
It is probably a query which populates the listbox "lstQueries" in the "frmReports"

form. But that form doesn't exist in my database. I have deleted it some time ago. I

thought that Compact and Repair got rid of stuff like this.
I found the definition in the MsysObjects and with this Id also in the MsysQueries.
So my question is obvious: what is this, why is this and what can i do about it?

Thx!

View 6 Replies View Related

Text String From Form Query - Multiple Choices

Aug 12, 2012

Been a while since I put hands on access. Working with a very simple database.

Working with 1 table, 1 form, 1 query.

Query has several fields. Field of interest contains names of counties.

In query design view I can type, "CountyA" Or "CountyB" or "CountyC" in the criteria and the desired results are returned.

On form I've created a text box and an open report button. The report I'm trying to open uses the query as the data source. I reference the text box on the form as the criteria for the query as follows:

[Forms]![frm_LMIBasicReport]![txtCounties][Forms]![frm_LMIBasicReport]![txtCounties]

If I enter the the name of a single county into the form it executes perfectly. If I try to enter multiple counties it fails. This is true whether I just enter the county names or replicate the exact criteria string I use in the source query. For example

CountyA works and returns desired values for County A
CountyA Or CountyB or CountyC fails. The report opens but no records are returned
"CountyA" Or "CountyB" or "CountyC" = exactly how it is entered in the query if I'm not using the form opens report but no records are returned

How can I pass multiple values from a single text box to the query.

View 1 Replies View Related

Data Capture

Mar 28, 2008

I have set up a standard form using asp code, the data currently get emailed to the address i requested, i also need this data to go in a database. any tips.

thanks in advance.

JR

View 1 Replies View Related

Capture Database Name In Access 97

Jun 16, 2005

Does anyone know what VBA code I use in Access 97 to capture the mdb file name of the database I am currently in? I need to enter into a field on a table.

Any help most appreciated.

Regards,

Dalien51

View 2 Replies View Related

Capture Day From Date Field

Dec 20, 2006

i was told that i didnt need to store the string value day.. eg.. monday.. tuesday.. because access can retreive the day based on the date..so...i have a textbox on my form that displays the date as follows..23/12/2006i am basically creating a html email and at the moment i use the following.. Option Compare DatabasePrivate Sub Command254_Click()'References: Oulook LibraryDim strEmail, strSubject As String, strBody As StringDim objOutlook As Outlook.ApplicationDim objEmail As Outlook.MailItemSet objOutlook = CreateObject("Outlook.application")Set objEmail = objOutlook.CreateItem(olMailItem)strEmail = Me.txtbookeremailstrBody = "<!DOCTYPE HTML PUBLIC '-//W3C//DTD HTML 4.01//EN' 'http://www.w3.org/TR/html4/strict.dtd'><html><head>" & _"<meta http-equiv='Content-Language' content='en-gb'><meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'></head><body>" & _"<p>" & Me.txtjobdate & "</p></body></html>"strSubject = "London Heathrow Cars - Booking Confirmation"With objEmail .To = strEmail .Subject = strSubject .HTMLBody = strBody '.Send 'Will cause warning message .DisplayEnd WithSet objEmail = NothingEnd Subthe email displays the date as it stands in the textbox..is there a standard method in access i can use to convert..23/12/2006 to Saturday 23rd December 2006??

View 12 Replies View Related

ComboBox Capture Event.

Jun 14, 2005

Hi:

This is something very simple, but I am messing it up terribely. If someone could please help me out with this.

I have a form which has a combo box. This combo box contains a list of Query names. What I am trying to do is simpely, when you highlight on any of the query names and click the run query button it should fire the query the result should be displayed in the datasheet view. I am not able to get a hang on how to do this.

It would be really helpful if someone could help me out with this as i need to get this done ASAP.

Thanks

View 9 Replies View Related

Capture Active Records

Jan 12, 2007

Hello,

I have a form to add data. I have a cmdbutton to output a shapshot of a report via e-mail. I have noticed that the shapshot does not capture the data I have just entered on the active form unless I don't first close the form.

Is there a way I can capture these active records?

Thanks.

View 9 Replies View Related

SQL To Capture Mispelt Emails

Aug 10, 2007

MS ACCESS 2000 SQL

I need to find out which emails in our database have our domain emails mispelt incorrectly.

For example, our domain email should be miguelangel.duo@leoburnett.es but it may be mispelt miguelangel.duo@loeburnett.es. How can I run an SQL that return the

FirstName, LastName Email from the Extract080907 table with mispelt email domain names?

Is this possible?

View 1 Replies View Related

Modules & VBA :: Separate Numbers And String From Alpha-numeric String

Jun 7, 2013

MS-Access VBA code to separate numbers and string from an alphanumeric string.

Example:

Source: 598790abcdef2T
Output Required: 598790

Source: 5789065432abcdefghijklT
Output Required: 5789065432

View 13 Replies View Related

Time (Labor) Capture Database

Apr 28, 2006

I need to create or adapt from a similar database a means to capture time (labor) spent on projects. I've searched for this topic, but have come up empty. Perhaps I'm just not searching on the correct search terminology. Here are the basic requirements:

One department can have many employees, but each employee is a member of only one department. An employee can be transferred from one department to another, and records created when the employee was a member of department 1 need to be retained under that department, while records created after the employee has been transferred to department 2 need to be recorded as such.

Projects can be worked on by any employee in any department. Many employees can work on any project.

Employees need to log in to the database daily and report the time spent on each project. A list of all projects needs to be displayed with the ability to enter the number of hours spent on each.

Reporting to include grouping of employees into departments; time spent by a department in total on each project; who worked on which project and total time spent.

There is a management shakeup here and I'm under a lot of pressure to get this done. I've done a very simple database, but nothing as complex as this.

Any and all help will be GREATLY appreciated.

View 3 Replies View Related

Auto Capture IP Address Into Field

Mar 15, 2008

Hi,

I am nearing the endgame of a FE/BE app. The FE will sit on various PC's across a LAN. IS there a way that when a user opens a record (via a form) on his FE (on his PC), the IP addy of that PC will be automatically entered into a hidden field on the form and store it in a purpose specific field on the BE table.

So I guess my question is how do I get the IP into a field on a table? Either "default" in the table, or via a field on a form? And what would the syntax for such an auto-populate be?

Thanks
Brian
Pretoria
South Africa

View 11 Replies View Related

General :: Capture Picture From Webcam?

Mar 26, 2015

I am developing a Student Database that shall capture Biometric and Pictures. I got the fingerprint on an access form. However I cannot get image directly from the webcam to an access form. I have to use the manufacturer's software to capture the image before importing to access using .picture property.

Is there any way of capturing the image directly from the cam to an access form?

View 1 Replies View Related

How To Capture If Multiple Columns Are Not Blank

May 20, 2015

Let's say I have three columns; apples, berries and bananas. I need to capture, either using the GUI or the SQL if any of those are not null, then bring that row back. So the rows that come back from the query are only ones where one of those three columns is not null.

In excel it would be if(or(apples<>"",berries<>"",bananas<>""),X,Y)

View 1 Replies View Related

Tables :: Create Log For Table To Capture Changes By Users

Mar 2, 2015

Is there a way of creating a log to capture changes in a table by users?

In a current database that I'm taking over, there was a lot of records deleted from the main table and now I need to figure out what happened.

So, if I would be able to have a log that records all the actions taken by users, I could at least see who did what.

View 13 Replies View Related

Modules & VBA :: Video Capture Using ActiveX Controls

Jan 10, 2014

Using Activex controls for capturing video from a webcam or similar. Just looking for a snapshot that I could then forward via email from access.

Ive seen commercial licenses for an activex control. The form Im imagining would have a window showing the live video with a snapshot button where we could store the image as a jpg for example and then generate an email forwarding on the image. It seems possible!

View 1 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved