Error Type:
Microsoft OLE DB Provider for ODBC Drivers (0x80040E14)
[Microsoft][ODBC Microsoft Access Driver] Syntax error (missing operator) in query expression 'Products.Catalogs LIKE '%[a-z]%' AND (Products.ItemName LIKE '%t'ai%') AND ((Products.NewItem = True) OR (Products.HotBuy = True)) ORDER BY Products.ItemName'.
/webdev/flaghouse/NEWITEM_List_Main.asp, line 149
this results when search terms contain a ' (SINGLE QUOTE). i've tried to double up all of the SINGLE QUOTES in the code and still get an error.
heres the CODE:
' check if keywords entered, split comma-delimited list into array of keywords
If Request("Keyword") > " " Then
theKeyword = Request("Keyword")
listKeywords = split(theKeyword,",")
maxCounter = ubound(listKeywords)
whereClause = "Products.ItemName LIKE '%" & listKeywords(0) & "%'"
FOR counter=1 TO maxCounter
theKeyword = listKeywords(counter)
whereClause = whereClause & " OR Products.ItemName LIKE '%" & theKeyword & "%'"
NEXT
SQLString = SQLString & " AND ("
SQLString = SQLString & whereClause & ")"
Else
theKeyword = "None"
End If
if anyone sees anything amiss, please let me know. i'm at wit's end!!
thanks. please email me at: URL. again, thank you in advance for your help.
When trying to update an access membership db where expired members are being set to 'inactive' the script keeps hanging up with a runtime error when the first or last name of the member has a single quote in their name (eg O'Neil)
Any ideas where to look to fix this would be appreciated.
I have a dropdown list called (cboClaimant) on a form which obviously allows the user to choose claimants from the list. However, if the user chooses a new claimant that is not in the list, they have the oppertunity to add to list or continue without adding, which is fine but:
If they then attempt to merge with one of the word documents that are linked to the Db, the merge fails because it cannot recognise the newly entered claimant. Hope this makes sense and that someone out there can help! here is the code that is running behind the cbobox:
Private Sub CboClaimant_NotInList(NewData As String, Response As Integer) Dim ctl As Control Dim stDocName As String ' Return Control object that points to combo box. Set ctl = Me!CboClaimant Response = acDataErrContinue ' Prompt user to verify they wish to add new value. If MsgBox("Claimant not in list. Do you wish to add new Claimant?", vbYesNo) = vbYes Then ' Set Response argument to indicate that data is being added.
stDocName = "frmClaimant"
DoCmd.OpenForm stDocName, acNormal, , , acFormAdd Forms![frmClaimant]![txtClaimant] = NewData Forms![frmClaimant]![txtClaimant].SetFocus Else ' If user chooses No undo changes. ctl = NewData ctl.Requery
End If Exit_cboname_NotInList_Click: Exit Sub Err_cboname_NotInList_Click: MsgBox Err.Description Resume Exit_cboname_NotInList_Click Me.Refresh End Sub
Okay, so I'm new here. I just recently got back into database development. My first job - stepping up a department's multiple Excel spreadsheets to an Access database. Sounds pretty easy, right? Here's the problem: Out of 5 different spreadsheets, 2 of them belong to other departments and are still modified daily. So, straight linking the excel file to access is not an option. A co-worker told me that I would need to set up a front, and back-end to the database. Still, that pulls on that Excel file and doesn't allow the other department to modify it. How do you go about creating a temporary file while you are modifying the data? I don't need to put any information back into the Excel Spreadsheet. The other problem is that they want to be able to track changes that the other department makes to the spreadsheet. Is this easily accomplished? I also have to keep in mind that multiple users will be using this database. Can anyone point me in the right direction? I'm getting stressed.
I need to design a database to house the following type of data (there are other fields involved to be connected to each person at each time eg tick box if attended):
Should I set up the the table structure data as: time(ie 7:00, 8:00 etc) Person(ie Person1, Person2 etc) PersonsID Attended (Yes/No)
and have four separate records for each time slot and use crosstab queries (Though I want users to be able to put their own name in, and I think using Access Crosstab that you cant do this :mad:)
and have only one record for each timeslot. If I did it this way how would I select and report on each individual person (would I need four separate queries?)
I am about to create a system where I want to use MS Access for data and MS Outlook for email,contact management etc. I have a dilemma (what do I use for storing the contacts)? I know I can use Access and use VBA to send emails etc but I also want the user to be able use Outlook directly to send emails etc as normal using that contacts (Outlook) list. Using Office XP at the moment btw.
I would appreciate comments as to the best way forward before I start. Thanks in advance.
I have a form with a sub form that opens based on a record search for a patient, whose details are displayed at the top in the main form. The sub form displays visit information for that patient (there can be multiple visits).
On opening the sub form is filtered and only shows one record at a time. I would like it to open and show all existing visit records for the patient and be ready to enter a new visit!
Resident Experts, I am currently working on a database to track the employee training for my company. Access is the only tool that is available and I'm definitely a novice. I'm working on a form to enter training event information and I have an option group and combo box problem. How can I disable a combo box until a certain option is selected?
I had made a database earlier for this customer but I worked with no process and so therefore I did the best I could. However, the customer has brought something to my attention that needs correcting.
The problem is that although the current database does record training events it doesn't produce reports which show what the employee hasn't done.
Because there are training events that pertain to everyone and then there are events that only pertain to individual employees based off of a 'job code' (which identifies their specialty) I've struggled to establish a link between employees and these two different types of training.
In an effort to correct this problem, I've added a 'project mandatory code' to the 'EmployeeInfo' table which holds all employee information along with their job code. Each time a new employee is entered into the table, a default value is entered into the project mandatory row.
I have seperate tables called 'JobCodes', 'ProjectMandatoryCode', and 'TrainingEventFrequency' which are connected to my 'TrainingEventInfo' table. The TrainingEventInfo table holds the information for all known events.
When a new training event is recorded, an entry is made into my 'CompletedTrainingRecord' table. This table records the event name, date completed, and the employee clock number.
Although I think my logic is sound, I may have missed something and made no progress at all.
Having said all that, the form I am working on to enter training events into the TrainingEventInfo table is where my original question came in. The option group I have has two choices: Project Mandatory Training and Position Related Training. If the user selects Project Mandatory Training then I want the combo box to be unavailable and based off the value it will automatically input a default value for the ProjectMandatoryCode. If the user selects Position Related Training from the option group I want the combo box to become active. My combo box is run from a query which pulls the job codes from the appropriate table and this value can then be written to the record in the TrainingEventInfo table.
Because both the ProjectMandatoryCode and the JobCode are in the EmployeeInfo table I'm hopeful that I can write a query which will pull all events, related to the individual, whether they have been completed or not.
Thank you in advance for any assistance you may be able to provide. I've attached a document which may be helpful. Respectfully, Dale Gagnon
I have a combo box that searches for surnames in my database. if there are two surnames the same, it brings up the first one. if this is not what i want then how can I ask it to search again instead of just pulling down the list and searching manually?
I've been asked if I can create a database which will act as a quote generator. There will be 5 components to make up the whole product. However, the options available for components 3, 4 and 5 will be dependant on the components chosen for 1 and 2. i.e. there may be 5 options for each component. If part 1a is chosen, then only parts 2c, 2d and 2e will be available. If part 1a and 2c are chosen, then only parts 3a and 3d are available and 4b, 4d and 4e are available. ...does any of this make sense?????
My question is... can anyone tell me how I should create the tables and the relationships to enable me to create a database like this. I am completely stumped. It may be that this is completley beyond me, but i'd like to at least be able to give it a try. Any help would be appreciated. Thanks
I have been trying to create a Quote form in my Database. I have a list of products, each product then has a table that details prices based on quantity breaks (i.e 500 to 999 and 1000 to 1999 etc.).
In my Form I am unable to create a subform in datasheet view that will enable me to select a product from a combo, type in a quantity and for the price to be displayed based on the quantity?
Has anyone managed to achieve this? I would love to see the code and put it into practice.
I am after a MS Access Database that will allow me to do up quotes and invoices for my small computer business does anyone know of any free access databases that will allow me to do this
If you know of any can you please let me know via email matthew01@gmail.com
As a basic user of Access I believe I have identified a use for the program for the purposes of a reporting task which I am charged with at the moment. We undertake the weekly tracking of proposals, which involves in brief, the action required for the bigger proposals, the teams involved in writing the proposals and follow up information as well as registration of wins and losses etc. At the moment we use Excel but I am finding it extremely labour intensive with entries having to be removed and captured by only one person on a weekly basis and when you are talking about 40 to 50 new proposals registered nationally in a week and about 100 updates on existing jobs it becomes a perpetual case of chasing your tail.
Am I right in thinking that if we were to design a simple, effective database with a form design that all our research directors could use with ease, and we could merely run reports off each week that this would not produce a far quicker reaction time when it comes to pooling international resources but also far more effective reporting system with which to produce our management summaries?
I am aware that this will probably require quite a bit of consultation on design but before I go shouting the merits of Access to any of my superiors I wanted to make sure I could be confident of Access's capabilities first?
Can anyone advise? point me in the right direction?
I am using DoCmd.TransferText to import a CSV file to a new table. The problem is some of the fields contain quotation marks which really messes things up for me later on. Is there some way I can go through the whole table and remove them?
ok basically im creating a quote system that will show users prices from one destination to the other destination based on the size of the vehicle..
you can see a similar quote system used on the following website.. http://www.londonairporttaxi.co.uk
there will be three main tables..
Airport Table airportID - primary key, autonumber airportNAME - text
the airport table will consist of 5 records..Heathrow,Gatwick,Stansted,London City, Luton
Town Table TownID - primary key, autonumber TownNAME - text
the town table will contain a list of postcodes, maybe 50 or so (n1,n2,n3,n4,e1,e2...)
Car Table CarID - primary key, autonumber CarNAME - text
the car table will consist of 4 records..Saloon,Estate,MPV,Executive
now what i need to do is create a similar quote system like there is on the url above..
my original idea would be to do something like this..
Have three tables that contain the quotes for each type of car..the first two listed here will work i think..
Airport2TownQuotes Table quoteID - primary key, autonumber carID - foreign key from car table airportID - the airport Pickup, foreign key townID - the town Destination, foreign key price - currency
Town2AirportQuotes Table quoteID - primary key, autonumber carID - foreign key from car table townID - the town Pickup, foreign key airportID - the airport Destination, foreign key price - currency
however.. for airport to airport quotes.. the resembling table would look something like this..
Airport2AirportQuotes Table quoteID - primary key, autonumber carID - foreign key from car table airportID - the airport Pickup, foreign key airportID - the airport Destination, foreign key price - currency
but you cannot place the airport id twice in the same table..(this maybe a case of simply renaming the airport fields in this table such as airport1, and airport2.. but can you still link them and enforce integrity if the fields have different names?)
also one example may be Heathrow to n1 is £30... this does not mean however that n1 to heathrow will be £30.. this is why i need to separate the quotes in this way.. for the 3 possible journeys (airport to airport, town to airport, airport to town).. also the quotes will be different for each car type..
anyway.. i shall be using asp to create a similar quote system on my website.. but i just need to get the final layout of the database sorted.
Hi Folks, I'm sorry to be stupid, here, but I can't get this to work. I have a parameter query that forms the basis for a report. To get the value for the query, I have a form on which the user selects the value they want from a combo box (cboProgram). The values in the combo box include all of the programs used in the file plus a value called "All" which means - just include all the records. My problem is that when "All" is selected in the combo box, no records are returned.
Things to mention: "All" has a value of 1 in the lookup table. I tried the query with the actual values and it works fine. The problem is when I try to do it from the combo box.
My first attempt was to put: iif([forms]![frmFormName]![cboPrograms]=1, "*", [forms]![frmFormName]![cboPrograms]) in the criteria for that field in the criteria box for lngPrograms.
Access' response was that the criteria value was too complicated to resolve.
So, I noticed that I wasn't saying 'Like "*"' in the first part, but if that's the problem then I can't get the numbers of quotes right. I also tried switching the iif statement around and saying <>1,[forms]..., else some version of 'Like "*", but that didn't work either.
Then I queried around the forum and found a recommendation to make a function to return the value, so I did the following:
In the criteria for the field in the query: IfAll([forms]![frmFormName]![cboPrograms])
And in a module:
Public Function IfAll(ProgSel) Select Case ProgSel Case 1 IfAll = "Like ""*""" Case Else IfAll = ProgSel End Select End Function
I'm still not getting it. If "All" is selected, value = 1, then no recorsd are returned. Can anyone help me out please?
I've been searching all the forums and unable to find my answer. What I want to do is show on a form the average quote for the specific model number.
On the form there is customer info, product info, etc. I want to see the average of what we have quoted every other time we have seen this product (we do repairs). The identifer for the product is the model number, Model#, the quoted cost is PRICE. I've used this function before, DAvg("[Price]","Repairs","[Model#]='013003020'") - which of course gives me the average for one specific model number (013003020). How would I use a similar function but have it do the average for the model number that I am viewing on the form?
If I am able to do that - I also need to find a way to not include nulls and zeros from the Price field.
I am creating an access database to store customer details as well as quote information. I have created a form to input quote details that our office can complete when a customer calls to complete a quote. I need to create a form that opens as a new form every time we click on the form to input a new quotation. How do I do this? At the moment when I click on the form, the form opens but the details of the last quotation are stored on the open form.
I have no training in access at all and am self taught so far so by no means an expert.I also want to create a form that allows you to search for particular quote numbers, so if someone calls and asks about a particular quote number we click on a page that says 'search quotes', input the quote number and the form opens with all the details of that quote.
I know that you can insert comments and notes in VBA code using a singular quote, like the following:
Code: 'Comment about what the code does
Is there a similar way to insert comments in the SQL of queries? I found other forum posts that say this isn't possible but those were all for pre-2010 Access. Has this changed at all?
I am trying to create a form with a button attached to each record that would allow the user to click the button and it would automatically open outlook and fill in the TO:, SUBJECT: and BODY: fields. Here is the code that I currently have:
Code: Private Sub Command33_Click() Dim strEmail As String Dim strMsg As String Dim oLook As Object Dim oMail As Object Set oLook = CreateObject("Outlook.Application") Set oMail = oLook.CreateItem(0)
[code]...
There are two issues I keep running into:
1. This code opens outlook and populates all of the fields but pastes the email incorrectly. Instead of pasting just the email (email@email.com) it pastes the html tags as well (email@email.com#mailto:email@email.com#) which means that the user would have to delete everything between the #'s in order to send the email every time.
2. I currently have the email BODY pulling from a table but this obviously limits what I can do. I would like to simply encode the BODY within the VBA code. The setup I am looking for is: one paragraph a blank line a hyperlink to a website a blank line another paragraph
Hi, thanks in advance for any help you can offer. I've got a table that has
Date Time Tag ID Power Level
throughout the day a computer listens to several tags (transmitters) and records the power level of the signal generated by the tag each 3 seconds. What I'd like to do is build a query that gives the Date, Time and Maximum Power level reading for each tag ID. I only want 1 record per tag per day
I've tried using "group by" and max in the query but this gives me all the times throughout the day.
I have a main form with 3 sub forms. The main form is tied to a table called QUOTES_MASTER. The first sub form is tied to a table called QUOTE_ LINE_ ITEMS_DIRTGLUE. It calculates the subtotal when selecting items. The relationship is one-to-many linked on QUOTE_ID.
The second sub form adds up total of all line items and is not tied to a table.The third sub form adds ESTIMATED FREIGHT to the PRODUCT TOTAL and is not tied to a table. how to get the values from the line items form inserted into the QUOTE_LINE_ITEMS_DIRTGLUE table as they are added.
I also want to insert the total value from ESTIMATED DELIVERED into the LINE_TOTALS field in the table QUOTES_MASTER.I tried this code on the product total sub form but it doesn't do anything and there are no errors:
Private Sub PROD_SUB_AfterUpdate() DoCmd.RunSQL "UPDATE QUOTE_LINE_ITEMS_DIRTGLUE SET QUOTE_LINE_ITEMS_DIRTGLUE.SUBTOTAL = Me.PROD_SUB WHERE QUOTES_MASTER.QUOTE_ID = " & Me.QUOTE_ID
I need help on this, from what the best concept is, to what I need to look into using:
I store Quote data from phone calls into tblQuotes. There is a seperate table that holds much of the same information except that it is for actual orders called tblOrders.
As far as function goes, I have each working much the way I need it to except for one thing... If a sales person is on the phone with a customer with a quote already in the system, right now they re-enter the data into the Order table. Most times, the order is what was quoted, but maybe with a few small changes (so I will wnt to keep a historical record of the quote). How could I copy the contents of the quote recordset into the recordset for an order, where all the sales rep does from there is edit the quote to the actual order?
Would I use VBA or an update query that is executed via VAB? Honestly, I am unsure how to do this at all, I hope someone has seen this before and has a good suggestion...