Making A Search Form And Sending Values To A Query
Nov 9, 2007
Hi, I am a complete idiot with VB/SQL/*anything for that matter*
Made an unbound form to search and retrieve records from a query (parameter query) (for property listings)
I've got the following fields in my "Search_Form"
1) Project (combo box pulls data from projects table)
2) Size (from - to)
3) Rate (from - to)
4) Date (from - to)
5) Price (from - to)
I've set variables for each field .... VAR_sizeFROM....... VAR_sizeTO etc.
Now here's my problem.
1) How do use VB to send the user inputs from my "Search_Form" to "Search_Query". And is it possible for either of the search fields to be blank in the form?
2)How can I do the same for a report?
Please help, I've been stuck with this for some time..
Thanks in advance
View Replies
ADVERTISEMENT
May 5, 2015
I am trying to create a query that takes values from a search form and provides records. I was having issues with getting results when some boxes on the form were left blank. I found a solution to that and it worked with a small number of fields. However when I make the full form query (about 8-10 fields) and run it says the query is too complex. I wrote the sql as I could not get designer to do what I wanted. Attached is the sql that works and that which is "too complex".
View 9 Replies
View Related
Dec 20, 2006
Hello I have a query in MSACCESS that looks like this
N| Q | A | B | C | D | E | F |
X|..4.|..1.|..6.|..7.|..9.|...|...|
now my problem is that I want to have a query select the 2 closes values to Q from columns either A B C or D and put them into columns E and F
I am just so stuck here, if anyone can help or give me a steer in a right direction i would greatly appreicate it!
View 1 Replies
View Related
Apr 1, 2014
I have got a form (name: SearchForm) that displays results of a query (name: AircraftSearch). It is a continuous form displaying multiple results of a search done by the query. I need to be able to send an e-mail to multiple recipients chosen from results displayed on the form.
One of the form's field (a text box called: EmailToOperator) is containing e-mail address to an aircraft operator selected by the underlying query. I need to be able to place a check box button (or something similar) that is going to select the e-mail address. The tricky part is to have multiple check boxes allocated for each record displayed on the form and have them working independently.
The second task is sending a one message (via Microsoft Outlook 2010) to chosen multiple recipients (with no attachments) having the recipients' addresses not visible to each other.
View 7 Replies
View Related
May 13, 2014
So I'm working on something for housing. Each house has a "Property Reference". This property reference links to all other information on the property.
There's two tables, Referral (For a tenant, with the Property Reference as a foreign key) and PropertyInfo (Holding all the property information)
Basically I want to save users as much input time as possible, so I'd prefer if they could just enter the property reference for a person, and that populates the rest of the table.
I'm currently using DLookup on the main form where it displays the information related to the property reference, obviously it's not actually being saved into any fields.
Will this method be okay if I would want to search the records by the address on the main form?
View 9 Replies
View Related
May 18, 2015
I have 3 text fields on a form that I search by. I have the search query action set on a button, which produces the results in a datasheet view. Is there any way that I can make the records in the datasheet view clickable so I can select the record and go to the form to update the data?
View 2 Replies
View Related
Aug 5, 2014
I have a search form that uses a query to show results of a search, but everytime I press search everything comes up even though I have entered search parameters, even though my search requeries every time and the search used to work before I added new records today. Also when I press the query alone on the navigation pane it asks me for the parameters and then it actually works but it won't when I use my form.
View 2 Replies
View Related
Mar 4, 2008
how can i send text from a text feild from one form to another form using that text as the criteria to run the query?
View 5 Replies
View Related
Apr 25, 2005
Hi guys,
i want to send an email to several people when someone else enters a complaint in my database.
I have a form which displays the complaint with a reference number, recordsource is "tblKlachten". i have query that is set to return only those emails i want it to send to called "qerMailBeheerder". In there is a field called "email".
Now, whenever i a user closes the form after adding a complaint, i want at the same time a mail sent to those ppl in the query with the subject the reference number of the complaint (field called "Referentienummer") and in the body other information from the fields on the form. Like the field "complaintdecription" and "clientname".
Now, i know about the sendobject thing, but i have tried alot and non would do what i want. Can anybody help me with the code.
Many thanks
View 8 Replies
View Related
Nov 1, 2007
Hello,
I am a little lost here. My prorgam has a form where I added a button. When clicking on the button, it is supposed to use some fields from the form and add them to an email with additional info which is added when the email opens up and is about to be sent. My boss uses Mozilla for his email account. What would be the code on the Onclick event be and do I have to set up anything else??
So far I have this code but it is for Microsoft Office Outlook not for Mozilla:
Set objOutlook = CreateObject("Outlook.Application")
Set ObjOutlookMsg = objOutlook.CreateItem(olMailItem)
With ObjOutlookMsg
.To = str_Recipient 'str_Recipient is obtained before this code
.Subject = str_Subject 'str_Subject is obtained before this code
.Body = str_Body 'str_Body is obtained before this code
.readreceiptrequested = lb_ReadReceipt
.Display 'to display the message instead of sending it
End With
Thank you very much
View 3 Replies
View Related
Jul 25, 2006
Hi,
So far I know there is a wizard for being able to create a button that sends a Form Report. What I really want to do though is when the user clicks the button on the form, just the form is sent/attached to the email, effectively giving the viewer/receiver a screenshot of the Form in question.
Thanks in advance,
Barret
View 8 Replies
View Related
Oct 11, 2004
I want to display Form and Report Simulteneously.
I am calling DoCmd.FormOpen in Open Method or Report.
I want report to be open and Dialog box should be sent back side of report.
Any help How to achieve that ?
View 1 Replies
View Related
Oct 12, 2006
I have two tables in MS access, both are same
but diffrent name like DataTable and DatatabelHistory,
what i have done is develop a form of DataTable and now want that the data entered in the textboxes of this form should copy/transfer to other table (DatatableHistory) by update event or some other event
View 9 Replies
View Related
Oct 17, 2006
Hi, I'm trying to run a query through a form, that takes several parameters and then checks to see if any rooms are booked at a certain time and date, that satisfy these parameters.
On the form there is :
Room - combo box
Time - text box
Date - text box
Computers - check box
Data projectos - check box
OHPs - check box
Desks - check box
I have this so far with the query. Can someone point me in the right direction on how to complete this successfully?
http://i113.photobucket.com/albums/n216/frosterley062/access.jpg
View 1 Replies
View Related
Aug 14, 2007
I have a Search Query based on a Form. It does not retrieve any columns from the table if any column is empty. Why? I thought the & "*" would find all records.
SELECT DISTINCT LITE.OWNER, LITE.LAMP_SUFF, LITE.LAMP_NUMBER, LITE.TOWN_CODE, LITE.ACCT_NO, LITE.STR_NAME, LITE.STR_DESC, LITE.WATTS_LITE, LITE.LUMENS
FROM LITE
WHERE (((LITE.OWNER) Like [Forms]![frm_search]![owner] & "*") AND ((LITE.LAMP_SUFF) Like [Forms]![frm_search]![lamp_suff] & "*") AND ((LITE.LAMP_NUMBER) Like [Forms]![frm_search]![lampno] & "*") AND ((LITE.TOWN_CODE) Like [Forms]![frm_search]![town] & "*") AND ((LITE.ACCT_NO) Like [Forms]![frm_search]![accountno] & "*") AND ((LITE.STR_NAME) Like [Forms]![frm_search]![strname] & "*") AND ((LITE.STR_DESC) Like [Forms]![frm_search]![location] & "*") AND ((LITE.WATTS_LITE) Like [Forms]![frm_search]![watts] & "*") AND ((LITE.LUMENS) Like [Forms]![frm_search]![lumens] & "*"));
View 4 Replies
View Related
Oct 16, 2007
How do I get my query to only pull out the records that have low values(*LV)/no value in a field?
View 2 Replies
View Related
May 9, 2005
This is a new post for this same question. The database that I am working on is set up in a very complicated way to me. The database tracks grant applications and awards. Right now there is a section in the database where one can enter a new record (Well this record is imported from an excel file filled in by the person who wants to update a current application or award for a grant) So when the amount changes on a grant a new record is created but the old information needs to be kept for future references. So this information is keyed into a subform on the same form as the new record. This is quite a bit of information, so I want to know if a button can be created to export this single record to the archive file set up on the same form (same format--different color fields- subform) Basically, I would also like to create a pop up question to say "Do you want to archive this record" the answer would be yes and the record would go to the archive subform (which is our archive query) I hope this makes sense. Thanks!
View 1 Replies
View Related
Jun 10, 2006
I am trying to send the information from a query in access into Avery in MS Word to print off as mailing labels.
The fields are:
1: First name
2: Last name
3: Street
4: Address 2
5: City
6: State
7: Zip
Is this possible?
Thanks
View 2 Replies
View Related
Nov 24, 2006
Hi people,
i have a search form with a list box. it is based on a query. it works fine for a different project but in this project i need to search for either a perfect match for an ID, or a 'like' match for description, or a like match for the customer.
i want the list box to have the
EventID, Description, CustomerName, CustomerSurname, EventDate
i want to choose which information i enter into the unbound boxes to return results in the list box.
What formulas would i need to enter into my query as a criteria so that it works.
Thanks guys, james
View 1 Replies
View Related
Feb 27, 2014
I am using Access 2010
I have a form to register deliveries to customers
ui would like to be able to do the following
1.- Have Access open an Outlook message window
2.- Popuilate the To: field with the shipping agency's email address (can be different shipping agencies, in each shipment we choose the agency from an existing table which contains the email address of each one)
3.- populate the Subkect fiel with "Pickup Notice # [ShipmentNumber]" whee [ShipmentNumber] is a control on the form
4.- Populate de body of the message wit some text and values from different records, such as
Dear [ShipAgentContact]
Please arrange pickup opf shipent # [ShipmentNumber]
There are [ShippedParcelss] parcels to pick up.
[Code].....
code I can modigy to do it?- Currently I use SendObject and send a report in PDF format but it would be much better not to send any attachment and put the information in the message body instead.
View 4 Replies
View Related
Aug 26, 2013
I am trying to send an email from a form in Access 2013 using fields on the form as part of the email body and I can't seem to find code to just do this.
I don't need to loop through tables as the send email address etc will be on the form together with appointment times etc ...
View 2 Replies
View Related
Apr 16, 2014
Code:
Public Function OPEN_SESSION() As Boolean
Dim objSession As Object
Dim strServer As String
Dim strMailFile As String
[code]....
but for some reason my form is not updating after sending the email.
View 1 Replies
View Related
Nov 12, 2013
I am trying to send an Email from a report . Using this code
Code:
On Local Error GoTo Some_Err
Dim MyDB As Database, RS As Recordset
Dim strBody As String, lngCount As Long, lngRSCount As Long
DoCmd.RunCommand acCmdSaveRecord
Set MyDB = DBEngine.Workspaces(0).Databases(0)
[code]....
I am getting an error on lblStatus.Caption.
View 5 Replies
View Related
Dec 16, 2013
I have a query that appends a new record to a table called "tblMain". The tblprogeny I am querying does not have two fields the 'tblMain' has (Group and Location). By the mere nature of this type data, the value for both fields are static thus I did not include them on the data entry form for the tblProgeny. I would like to include them on the append query if I can. One field is "Group"with the static value at "Non-Active" and the other is "Location" where the static value is "Nursery"
I have tried to use the following expressions in the criteria field of each respective field slot of the query:
[tblgroup.group to tblmain.group] 'Where ([tblgroup.group]= "Non-Active")'
[tbllocation.location to tblmain.location] 'Where([tblLocation.Location]= "Nursery")'
But it gives me an error that my syntax is not right? tblgroup.group to tblmain.
View 3 Replies
View Related
Jan 2, 2015
In the following code, I debug a problem with the CurrentDb.OpenRecordset
Code:
' ---
' ENVOYER UN MAIL DEPUIS ACCESS
' ---
' Entree : strEmail <- Adresse e-mail du destinataire
' strObj <- Objet du courrier
' strMsg <- Corps du message
[Code] ....
View 7 Replies
View Related
May 19, 2006
Hello,
I have a form with a listbox on, the listbox uses a query to populate it, which returns a list of client names. The idea is, when I enter the clients name in a text box, the list is narrowed, through use of the query.
This works fine, and always has - very pleased with it, the problem comes when I decide I want to be able to search on the account number as well - which it always throws errors about.
I am using the following query (posting the sql, hope that is OK)
SELECT tblSafeKeep_Clients.SafeKeepClientID, tblSafeKeep_Clients.Title, tblSafeKeep_Clients.Initials, tblSafeKeep_Clients.Surname, Format(tblSafeKeep_Clients.DesignationNumber,"000000") AS Expr1
FROM tblSafeKeep_Clients
WHERE (((tblSafeKeep_Clients.Surname) Like "*" & [Forms]![frmSafeKeep_SelectClient]![txtSearchText] & "*")) OR (((tblSafeKeep_Clients.DesignationNumber)=[Forms]![frmSafeKeep_SelectClient]![txtSearchText]));
The problem is because I am only using ONE text box, but the surname is (obviously) text, and the account number is (obviously!) a number. SO - it throws a wobbler about it being too complex to evaluate when I try to search for a surname, trying to search for an account number works just fine.
Any ideas how to get around this?
View 3 Replies
View Related