Microsoft Office

Microsoft Office Questions? Ask a IT Expert for Support ASAP

Ask a Computer Expert,
Get an Answer ASAP!

Microsoft Office
This answer was rated:

I need some guidance for Microsoft Access 2010, to create some

simple programming statements to use...
I need some guidance for Microsoft Access 2010, to create some simple programming statements to use in either reports, forms or queries. I have a 2000+ record DB created and now need to do some more complex programing to get the results I need. I have some skills in Access programming but I am a bit rusty. Could someone help with some programming statements and also some guidance regarding where best to use these snippets, queries, reports, etc?
Show More
Show Less
Ask Your Own Microsoft Office Question
Answered in 4 hours by:
8/21/2013
Richard
Richard, Software Specialist
Category: Microsoft Office
Satisfied Customers: 41,015
Experience: Over 15 year experience resolving Microsoft Office Issues
Verified
Thank you for your question, my name is Richard.

I can help you with this.

What exactly would you like to achieve for functionality in the database?

Thank you
Ask Your Own Microsoft Office Question
Customer reply replied 4 years ago
Relist: Answer came too late.
Hi Dave,

There is no answer I have given.

I asked you a question, but you may have missed this?

I will repeat it

"What exactly would you like to achieve for functionality in the database?"

Thank you
Ask Your Own Microsoft Office Question
Customer reply replied 4 years ago

Hi,


Sorry I though we missed each other and my timeline is getting tight.


 


I am an adequate Access user and have done many designs over the years. However I lack the programming skills to get the most out of queries, reports, etc., especially when the needs require some programming skills. I can sometimes adapt code that I see for my own needs, other times not. I can do simple macros sometimes and calculated fields when the math is moderate. I can usually get around simple queries ok until I need to use more complex functions. I am rusty as I have not done much with it in a few years.


 


I am a little confused if I should be doing my programing statements the query? Query is preferred.


 


This is a DB for rounds of golf played in a 2 yr. period. It has about 12 fields which I imported from another tournament tool my club uses. I have about 2100 rounds of golf with score, date, handicap, player name, course, score, slope, position, etc.


 


The need is to award fixed points for where the person finished in every tournament and then sum it. There are 5 places in most tournaments but for this exercise I need to assign points to the 1st, 2nd, 3rd position.


 


I have a number field called “position”, for each golfer in 30-40 tournaments which is the place the golfer finished. I need to automate a process in which for each position, Access will assign a fixed # XXXXX points for each position but only positions 1, 2, 3.


 


For each position 1 the player should accumulate 3 points. For each position 2, accumulate 2 points and of each position 3 accumulate 1 point. And get a sum for each person.


 


What is the best way of handling this?


 


Thx Dave

ok, you want to use a query when possible, there easier to make and maintain. But it is not always possible.

It depends on the data flow eg: Are you inputting it via a form, or importing it direct to the Tablet.

If you are importing it directly into the Table, you will then want to run an update query to update the values.

Else if you input it via a form, you would use an event trigger (a macro on the after update event when inputting the data).

So the question is, how does the data get into your database?

Ask Your Own Microsoft Office Question
Customer reply replied 4 years ago

I imported all of the fields from a custom report I created in the other tournament tool we have. I exported to Excel and then appended it into the DB. I had to do this about 40 separate times, one time for each tournament.

ok, then create an update query, and do it this way Dave.

Have you created these before?

Ask Your Own Microsoft Office Question
Customer reply replied 4 years ago

Yes, I have created update queries. There are no examples in your last message after "do it this way Dave". What am I updating and why, if you don't mind?


 

Of course not, and working on your explanation, you would update by using a query like the below

For 1st place you would use this

UPDATE tblPlayers
SET [Points] = 3,
WHERE [positionFinished] = '1'

You would then create a second query for 2nd place

UPDATE tblPlayers
SET [Points] = 5,
WHERE [positionFinished] = '2'

And for third place the following

UPDATE tblPlayers
SET [Points] = 3,
WHERE [positionFinished] = '1'

I am just using pseudo query, but it demonstrates how the update queries are created, which you would run after the importing of data.

Then you would have another query that does the summing this way.

Select Player, Sum(Points) as TotalPoints from tblPlayers group by Player

This will then show the total points per person.

Please let me know Dave if you need clarification on any points.



Ask Your Own Microsoft Office Question
Customer reply replied 4 years ago


That seems like a good approach. Will it create a new field in the table named Points?


 


My table name is XXXXX XXXXX I suspect I would replace tblPlayers with tblMain as I run the update queries?

No, you need to make the field Points, a query will never make fields

Correct on that, except not tbl

You would just use Main (as this is the tables name)
Ask Your Own Microsoft Office Question
Customer reply replied 4 years ago

Ok, I see if I can put this together. I would like a field in table Main that contains the points after the update query. Then I can make a calculation field in Main which will add the points together.


 


Any thoughts as I import new data after each tournament, maybe 1-2 x monthly. Will I need to keep using the update query?


 


Maybe one more thing: How do I count the number of times a person appears in the DB? I also need to count the # XXXXX tournaments they played in, which would come from their many records in the DB?


 

You dont save the calculation field in the table, you never do, just calculated it when presenting the data.

else yhou would need an update query for this as well, but thet de-normalises the data, so you want to avoid this.

You will need to run the query everytime that you add the data, as you need to update it again.

To count the amount of times a person appears, you would use this query

SELECT Count(Player) AS CountOfPlayer
FROM main
GROUP BY Player;

This will show each player and how many times they appear David.

Let me know if this makes sense please.

Thank you
Ask Your Own Microsoft Office Question
Customer reply replied 4 years ago

Richard,


I am getting syntax errors on both of these. Tried a few changes, no luck. Here is what I did. I am using Access 2010 btw.


 


Did you want me to use an actual update query or a std query? Tried both. Opened a std query. Opened the "Expression Builder". The builder approach puts all of this into the field line in the query. I created a field in Table Main for Points.


 


Typed in the following:


 


UPDATE (tblMain)
SET ([Points] = 3,
WHERE [Fltpos] = '1'


 


Ran the query and kept getting syntax errors. Tried moving the paran around, etc.


 


Did I do this correctly?


 


 


 


 

Hi Dave,

Sorry I was offline.

You have an unopened bracket, this is the problem

Change
UPDATE (tblMain)
SET ([Points] = 3,
WHERE [Fltpos] = '1'

To

UPDATE (tblMain)
SET [Points] = 3,
WHERE [Fltpos] = '1'

Also make sure your Main table is indeed called tblMain (I believe you said it was Table)?

Let me know the results please

Thank you
Ask Your Own Microsoft Office Question
Customer reply replied 4 years ago

Richard,


Still getting invalid syntax errors. I have tried multiple different approaches. All in one line, in three lines, just as you offered. I deleted that open paren. Still general syntax error


 


This update statement is not going to change the data in Fltpos, correct?


 


SET [Points] actually does what? Does this create a new field in the query so that we are not modifying the data in Fltpos? I need to have this data unchanged as I may have to experiment with the # XXXXX points for awhile.


 


The Fltpos is defined as a numeric field,FYI. Still need " 1"


 


Thx Dave

ok, I will break down the statement.

First, SET [Points] is what sets the value to the Points Field.

This you need to create in the Database, like any field you create to store data.

WHERE [Fltpos] = '1'

This is the Where condition. Basically like an if statement. If does not change Fltpos but checks it.

Look at it like this normal if statement

if fltpos = 1 then set the value of Points to 1

this is in effect what your update query is doing.

Let me know if you have any difficulties please

Ask Your Own Microsoft Office Question
Customer reply replied 4 years ago


Yes, great, thank you. That is what I want to do.


 


I have a field in Main named Points and is set to numeric.


 


The complete statement still has invalid syntax.


 


Thx Dave


 


 


 

ok, its best for me to look at the database Dave.

- Click the following link: http://www.wikisend.com
- Upload the file to that website
- Once it is uploaded, the resulting page will display a "File ID" number.
- Please, give me that "File ID Number"

Thank you
Ask Your Own Microsoft Office Question
Customer reply replied 4 years ago

Ok Richard,


File ID is 545262


 


Don't know why the size of this test version is about 1/3rd the size of the production version. It looks like it has all of the data. I tried the query in a few versions and same syntax error - operator with no operand.


 


Thx Dave


 


 


 

oko, I want to avoid (unless you say so) just doing this for you, as I can see you want to learn this.

First, which query have you been working on?

Ask Your Own Microsoft Office Question
Customer reply replied 4 years ago

It would not save it because of the syntax error, so it is not present. It was a new query with just that one statement in it.


 


Go ahead and create. I was wondering should I be putting the content into the expression builder , which goes into the first line of a query or should I be putting it into the SQL

ok, I see the issue

I have done the first one, download it from www.wikisend.com

File ID# XXXXX

Let me know how you go making the second one please.

Ask Your Own Microsoft Office Question
Customer reply replied 4 years ago

Thanks Richard! You had the points distribution wrong but I fixed it Wink


I tried to add the other two situations into the same query but it didn't like it.


 


Do I have to create three independent queries to update the three different point arrangements?


 


Couldn't we just create an IIF statements that will update Points?


Like this, just not sure of the syntax and also how to add a CREATE command if we can.


 


IIF Fltpos=1, 3, Null, IIF Fltpos=2, 2, Null, IIF Fltpos=3, 1, Null


 


Dave

yes, you have to have three independent queries Dave,

No on the code, in a Query, you are updating based on a condition, and this update needs to work off one condition.

This is why you need the three queries.

sorry about the points, but I was going off your statement

"For each position 1 the player should accumulate 3 points. For each position 2, accumulate 2 points and of each position 3 accumulate 1 point. And get a sum for each person."

Maybe I mis understood this?

But make the second and third query and let me now how you go please.

Thank you
Ask Your Own Microsoft Office Question
Customer reply replied 4 years ago

Hi Richard,


 


Thanks that worked ok, created the other two update queries and it is doing what I wanted. Can you explain why you went from an SQL statement to simply using the update query?

I didn't Dave.

The SQL statement is an update query.

Your just viewing the code as a graphical representation, in design view, which is a feature of MS Access.

It is SQL code I used.

To explain, SQL is the Language for Queries. It is like English, or Chinese.

With SQL, you can do a lot, but the basics are

Select and view data
Delete Data
Update Data
Add Data

Theres are the 4 main uses of the SQL language.

We together used it to Update Data. The entity that SQL resides in is referred to as a query.

Does that make sense?

Ask Your Own Microsoft Office Question
Customer reply replied 4 years ago

Yes, I guess it does make sense. The query is a graphical representation for ease of use and it actually builds the SQL which does the work, is that right?


 


You have been great to work with Richard. Thanks for all of the info and your patience.


 


Where are you located east coast US or further east of that? I am in Calif

Yes that is right. Microsoft best value to IT has been graphical representation of complex things.

I have also enjoyed working with you Dave.

I am located in the Netherlands. The land of Windmills and Cheese, though spent quite a lot of time in the past in Foster City, Milpitas, San Jose and a few other places in California.

If you need anything else ever in the future, feel free to let me know.

If you would like any additional information or assistance, please do not hesitate to let me know.

And if you can take a second to rate my service, that would be greatly appreciated.

Thank you
Richard
Richard, Software Specialist
Category: Microsoft Office
Satisfied Customers: 41,015
Experience: Over 15 year experience resolving Microsoft Office Issues
Verified
Richard and 87 other Microsoft Office Specialists are ready to help you
Ask your own question now
Customer reply replied 4 years ago


Thanks again! I live near Foster City, in Belmont, just south of San Mateo. I have been in the computer field for many years, mostly in a sales/management capacity. I sell professional services to IT for many years. Many large projects to large companies in the Bay Area in the $1M plus sized jobs. Between jobs at the moment but expect to ramp up my search now that summer is just about over.


 


This is a project for the golf club I belong to in San Mateo. I am the Handicap Director and we are using this tool along with others to manage members scores.


 


I'll drop you an email or re-connect through Answer if I need anything else.


 


Thx Dave

Thanks Dave,

Can't say which company I worked in Foster City, but I would put money on it we met up once if you sold in the area at that range.

Looking forward to our next interaction.

Richie
Ask Your Own Microsoft Office Question
Customer reply replied 4 years ago

Let's see if I can guess.....Foster City...Visa, Sprint, Franklin Resources, Gilead Sciences, Electronics For Imaging, maybe Sony, Applied Biosciences??? Did I get close?

some of the above :)

Take care Dave

Ask Your Own Microsoft Office Question
Customer reply replied 4 years ago


Have a nice rest of the summer!


You take care as well.


 


Dave

Ask Richard Your Own Question
Richard
Richard
Richard, Software Specialist
Category: Microsoft Office
Satisfied Customers: 41,015
41,015 Satisfied Customers
Experience: Over 15 year experience resolving Microsoft Office Issues

Richard is online now

A new question is answered every 9 seconds

How JustAnswer works:

  • Ask an ExpertExperts are full of valuable knowledge and are ready to help with any question. Credentials confirmed by a Fortune 500 verification firm.
  • Get a Professional AnswerVia email, text message, or notification as you wait on our site. Ask follow up questions if you need to.
  • 100% Satisfaction GuaranteeRate the answer you receive.

JustAnswer in the News:

Ask-a-doc Web sites: If you've got a quick question, you can try to get an answer from sites that say they have various specialists on hand to give quick answers... Justanswer.com.
JustAnswer.com...has seen a spike since October in legal questions from readers about layoffs, unemployment and severance.
Web sites like justanswer.com/legal
...leave nothing to chance.
Traffic on JustAnswer rose 14 percent...and had nearly 400,000 page views in 30 days...inquiries related to stress, high blood pressure, drinking and heart pain jumped 33 percent.
Tory Johnson, GMA Workplace Contributor, discusses work-from-home jobs, such as JustAnswer in which verified Experts answer people’s questions.
I will tell you that...the things you have to go through to be an Expert are quite rigorous.

What Customers are Saying:

My Expert answered my question promptly and he resolved the issue totally. This is a great service. I am so glad I found it I will definitely use the service again if needed.

One Happy CustomerNew York

Wonderful service, prompt, efficient, and accurate. Couldn't have asked for more. I cannot thank you enough for your help.

Mary C.Freshfield, Liverpool, UK

This expert is wonderful. They truly know what they are talking about, and they actually care about you. They really helped put my nerves at ease. Thank you so much!!!!

AlexLos Angeles, CA

Thank you for all your help. It is nice to know that this service is here for people like myself, who need answers fast and are not sure who to consult.

GPHesperia, CA

I couldn't be more satisfied! This is the site I will always come to when I need a second opinion.

JustinKernersville, NC

Just let me say that this encounter has been entirely professional and most helpful. I liked that I could ask additional questions and get answered in a very short turn around.

EstherWoodstock, NY

Thank you so much for taking your time and knowledge to support my concerns. Not only did you answer my questions, you even took it a step further with replying with more pertinent information I needed to know.

RobinElkton, Maryland

< Previous | Next >

Meet the Experts:

jstinehelfer

jstinehelfer

Information Systems Manager

36 satisfied customers

A+ Comptia Certified computer repair

JasonJames122

JasonJames122

Computer Enthusiast

0 satisfied customers

I manage all information systems (network of Windows PC's and servers with Microsoft Office products) for a small business

Jess M.

Jess M.

Computer Support Specialist

701 satisfied customers

Computer Software Specialist for more than 10 years

The-PC-Guy

The-PC-Guy

Computer Manager

588 satisfied customers

20 years experience providing remote computer support

James K.

James K.

Consultant

260 satisfied customers

Technical Director of IT Company

IT Miro

IT Miro

Computer Scientist

157 satisfied customers

Bachelor's Degree in Information Technology, Microsoft Certified Professional

Chris L.

Chris L.

Support Specialist

147 satisfied customers

Certified Expert with over 10 years experience.

< Previous | Next >

Related Microsoft Office Questions
There was an update today and since I did it I can't open
There was an update today and since I did it I can't open Word. There was one for PowerPoint and Excel and they are all fine … read more
bbao
bbao
Freelance IT Consultant
74 satisfied customers
I can't recover a really important document that I was
I can't recover a really important document that I was working on … read more
bbao
bbao
Freelance IT Consultant
74 satisfied customers
I'm having trouble with creating an automatic table of
I'm having trouble with creating an automatic table of contents in Word. I think it has something to do with formatting in the document. … read more
Kris R
Kris R
IT Manager
Computing
2,629 satisfied customers
When I type an e mail to a particular person, how do I
When I type an e mail to a particular person, how do I include multiple names recipients . … read more
Jess M.
Jess M.
Computer Support Specialist
Bachelor's Degree
701 satisfied customers
I have a document on one drive that wont open because the
I have a document on one drive that wont open because the file is corrupted. How can I open the document. It represents a weeks work. Would it help to use a different computer? … read more
Kris R
Kris R
IT Manager
Computing
2,629 satisfied customers
I have two cars a Hummer & Maserati I was able to access the
I have two cars a Hummer & Maserati I was able to access the Hummer, now I would like to use it on the Marz how do I do it? … read more
Kris R
Kris R
IT Manager
Computing
2,629 satisfied customers
I just downloaded outlook 2016 but cannot open it. I get the
I just downloaded outlook 2016 but cannot open it. I get the following message: "Cannot start Microsoft Outlook. Cannot open the outlook window. The set of folders cannot be opened. The outlook data f… read more
Viet - Computer Tech
Viet - Computer Tech
Computer Technican
Bachelor\u0027s Degree
953 satisfied customers
My laptop crashed with the last Windows 10 update. I had to
My laptop crashed with the last Windows 10 update. I had to buy a new laptop, but I need to recover my Microsoft 365 account. My contact information was on my old laptop. How do I recover my files? I … read more
Michelle
Michelle
Manager operations
Bachelor\u0027s Degree
1,275 satisfied customers
I had issues with slow indexing in my Outlook 2013. Went for
Hi there, I had issues with slow indexing in my Outlook 2013. Went for repair on line (after trying quick repair) - got a error message (crash) and all my Office 2013 package disappeared from my lapto… read more
Richard
Richard
Software Specialist
41,015 satisfied customers
We have Microsoft Word on our old computer under Wayne and
We have Microsoft Word on our old computer under Wayne and Beth Raasch Product ID 03***-***-****774-02692. When we tried to load it onto our new computer it asks for a 25 number long ID. This is all w… read more
Kris R
Kris R
IT Manager
Computing
2,629 satisfied customers
My spreadsheet appears to be locked. It won' T let me input
My spreadsheet appears to be locked. It won' JA: What application are you using? Customer: t let me input numbers or alph JA: Have you installed any updates recently? Customer: Excel, no JA: Anything … read more
bbao
bbao
Freelance IT Consultant
74 satisfied customers
My email account has suddenly started asking me for a
My email account has suddenly started asking me for a password ***** when I key in what I know to be the correct passwords … read more
Moses C
Moses C
Bsc
332 satisfied customers
I just updated my Office package today, & now I'm missing
I just updated my Office package today, & now I'm missing the Frutiger font I purchased. It shows up in FontBook but not in the MS Word list. Most of my documents have a substituted font. How do I get… read more
bbao
bbao
Freelance IT Consultant
74 satisfied customers
New HP PC. Tried to share a file (failed). Unable to close
New HP PC. Tried to share a file (failed). Unable to close Word. Was using Yahoo mail. Just set up Outlook. Still unable to close Word. Get error about new message. Not sure what to do. … read more
Cris
Cris
58 satisfied customers
I have a word file of 542 mb. Word won't open it reason it's
Hello there. I have a word file of 542 mb. Word won't open it reason it's larger than 32 mb in size. (However it will open a 330.4 mb file, both of which contain images and text). … read more
Jess M.
Jess M.
Computer Support Specialist
Bachelor's Degree
701 satisfied customers
I bought Word in 2013 for a lifetime, and a few weeks ago it
I bought Word in 2013 for a lifetime, and a few weeks ago it quit working. It won't open. … read more
Jess M.
Jess M.
Computer Support Specialist
Bachelor's Degree
701 satisfied customers
Is there a way to recover a document accidentally deleted
Is there a way to recover a document accidentally deleted from recycle bin? … read more
Chris L.
Chris L.
Support Specialist
Vocational, Technical or Trade Scho
147 satisfied customers
I recently re-subscribed to Office 365 as support for One
I recently re-subscribed to Office 365 as support for One Drive on my iPad so that I can use either the iPad or my Mac Book Pro for work. My problem is I can't find all the editing tools I need to typ… read more
bbao
bbao
Freelance IT Consultant
74 satisfied customers
Disclaimer: Information in questions, answers, and other posts on this site ("Posts") comes from individual users, not JustAnswer; JustAnswer is not responsible for Posts. Posts are for general information, are not intended to substitute for informed professional advice (medical, legal, veterinary, financial, etc.), or to establish a professional-client relationship. The site and services are provided "as is" with no warranty or representations by JustAnswer regarding the qualifications of Experts. To see what credentials have been verified by a third-party service, please click on the "Verified" symbol in some Experts' profiles. JustAnswer is not intended or designed for EMERGENCY questions which should be directed immediately by telephone or in-person to qualified professionals.

Disclaimer: Information in questions, answers, and other posts on this site ("Posts") comes from individual users, not JustAnswer; JustAnswer is not responsible for Posts. Posts are for general information, are not intended to substitute for informed professional advice (medical, legal, veterinary, financial, etc.), or to establish a professional-client relationship. The site and services are provided "as is" with no warranty or representations by JustAnswer regarding the qualifications of Experts. To see what credentials have been verified by a third-party service, please click on the "Verified" symbol in some Experts' profiles. JustAnswer is not intended or designed for EMERGENCY questions which should be directed immediately by telephone or in-person to qualified professionals.

Show MoreShow Less

Ask Your Question

x