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..
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".
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.
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?
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?
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.
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.
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
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.
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
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?
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] & "*"));
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!
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.
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.
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 ...
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)
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.
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
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.