Queries :: How To Insert Comments And Notes Using Singular Quote
Feb 5, 2015
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?
How to extract the comment system from the Contacts Web Database template found in Access 2010? I can upload it if you like.
I would like to use it in a standard desktop database to track notes and comments in my records.
I am able to convert it from web to standard, but it still appears to use data macros or something, and my knowledge on macros is limited.
I just want to keep a history of my notes for each record, with the most recent always listed, and the comment system in the Contacts Web Database template seems perfect for that. I just don't know how to implement it into my desktop database.
I'm using Access 2013, with a standard database (non web).
I am trying to figured out a method to keep track of notes and comments that are entered into a record. I would like them to be time stamped, and the most recent listed first.
Do I have to use a split form or similar to do that? Is there a intermediate to easy method of accomplishing this task?
If anyone has seen the Contacts Web database template in Access 2010, the 'Add a Comment' section would be ideal to what I'm looking for. Unfortunately, I'm not sure how to implement it into my database.
I have a query that holds data based on a field. If the field [Device In] is "TimeStation-1" in TblTime for example it holds "AV" in the field [House]. Trouble is some fields are blank and when this is so I want it to pull the last two letters from the [Notes] field. I have attached the database. The query is [QryDeductionsandSleep Ins].
I have a normalized DB with one to many relationships, using Primary and Foreign Keys.
I need to do inserts and maintain the PK/FK relationship, which means when I add a new PK I need to insert that PK as FK in other tables in the same transaction.
How do I do this in Access? SQL Server I use transactions, but I can't lock up the tables in Access like that.
I did a bunch of searching and found nothing, which leads me to believe I am way off in my thinking. Below are the dirty details
I have 2 tables, tblName and tblPhone. 1 name can have many phones.
tblName has PKName. tblPhone has PKPhone, FKName.
I have a form where user enters a new Name and PhoneNumber.
Name gets inserted to tblName, assigned with PKName = 100
Phone should get inserted into tblPhone with PKName.
IE Insert into tblPhone (FKName, PhoneNum) VALUES (100,"212-555-1212").
The dumb way I am doing it now is I insert to tblName, query tblname for the PK, then write to tblPhone. This can't be right.
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.
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.
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.
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
Hi Alli, I have a database that has a comments field. The database has a status field: Plan Test and Run, in the comments field the user adds comments, i'm trying to updated the comments with the status, for example; the user added some comments like. "The test will begin next week" I want the comments feild to automatically get updated when the user changes the status for example to Run, I want the "run status to be added to end of the comments line" can somebody help? Thanks.
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.
On our site we have option where users can add coments to articles. Lately some people have been misbehaving. I wish to add a field in .mdb file and call it "approved". If the field contains "1" then it's ok to show the message, if the field has nothing in it comment will not be shown. How do I implement this into below code. I wish to leave posting as is, just not showing not yet approved comments.
Thank you in advance. (comments are shown in <td>" & rs("Comment") & "</td> part)
Here is the code:
' show past comments If Not rs.EOF Then
s = s & " <tr bgcolor=""" & TitleBGColor & """>" & vbCrLf s = s & " <td colspan=""3""> Comments:</td>" & vbCrLf s = s & " </tr>" & vbCrLf
While not rs.EOF s = s & " <tr class=""" & TitleClass & """>" & vbCrLf s = s & " <td> </td>" & vbCrLf s = s & " <td>From:</td>" & vbCrLf s = s & " <td>" & rs("Name") & " (" & rs("DateAdded") & ")</td>" & vbCrLf s = s & " </tr>" & vbCrLf s = s & " <tr>" & vbCrLf s = s & " <tr class=""" & TitleClass & """>" & vbCrLf s = s & " <td> </td>" & vbCrLf s = s & " <td>Comment:</td>" & vbCrLf s = s & " <td>" & rs("Comment") & "</td>" & vbCrLf s = s & " </tr>" & vbCrLf s = s & " <tr>" & vbCrLf s = s & " <td> </td>" & vbCrLf s = s & " <td> </td>" & vbCrLf s = s & " <td> </td>" & vbCrLf s = s & " </tr>" & vbCrLf rs.MoveNext Wend End If
We have several users that access the same database. Is there a way to make it so that the users can add comments to the "coments" field on the form, but not remove any comments once saved?
I have a comments on my form. I have contacts with them having from 1 to many customers accts. I am trying to come up with a way to update the comments for a contact that adds those comments to all their customers records...but not to those that have been closed. How would I add these comments to the comments on the form without overwriting the current comments.
Comments - Memo Contact - Text
It's quite a pain, copying and pasting from record to record.
Firstly, I would apologise as I am not overly familiar with the correct terminology!
I need to create a "space" on my form whereby I can add comments etc which will exceed 255 characters: these comments will be specific to each record. I have tried having an "unbound" text box in design view but this makes the comments the same on each record.
I know this is probably "as clear as mud" but if anyone can help I would be really grateful.