How JustAnswer Works:

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

Ask Richard Your Own Question

Richard
Richard, Software Specialist
Category: Microsoft Office
Satisfied Customers: 16842
Experience:  Over 15 year experience resolving Microsoft Office Issues
32989067
Type Your Microsoft Office Question Here...
Richard is online now
A new question is answered every 9 seconds

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

Resolved Question:

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?
Submitted: 1 year ago.
Category: Microsoft Office
Expert:  Richard replied 1 year ago.
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
Customer: replied 1 year ago.
Relist: Answer came too late.
Expert:  Richard replied 1 year ago.
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
Customer: replied 1 year 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

Expert:  Richard replied 1 year ago.
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?

Customer: replied 1 year 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.

Expert:  Richard replied 1 year ago.
ok, then create an update query, and do it this way Dave.

Have you created these before?

Customer: replied 1 year 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?


 

Expert:  Richard replied 1 year ago.
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.



Customer: replied 1 year 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?

Expert:  Richard replied 1 year ago.
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)
Customer: replied 1 year 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?


 

Expert:  Richard replied 1 year ago.
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
Customer: replied 1 year 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?


 


 


 


 

Expert:  Richard replied 1 year ago.
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
Customer: replied 1 year 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

Expert:  Richard replied 1 year ago.
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

Customer: replied 1 year 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


 


 


 

Expert:  Richard replied 1 year ago.
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
Customer: replied 1 year 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


 


 


 

Expert:  Richard replied 1 year ago.
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?

Customer: replied 1 year 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

Expert:  Richard replied 1 year ago.
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.

Customer: replied 1 year 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

Expert:  Richard replied 1 year ago.
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
Customer: replied 1 year 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?

Expert:  Richard replied 1 year ago.
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?

Customer: replied 1 year 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

Expert:  Richard replied 1 year ago.
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, Software Specialist
Category: Microsoft Office
Satisfied Customers: 16842
Experience: Over 15 year experience resolving Microsoft Office Issues
Richard and 6 other Microsoft Office Specialists are ready to help you
Customer: replied 1 year 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

Expert:  Richard replied 1 year ago.
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
Customer: replied 1 year 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?

Expert:  Richard replied 1 year ago.
some of the above :)

Take care Dave

Customer: replied 1 year ago.


Have a nice rest of the summer!


You take care as well.


 


Dave

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 Customer New York
< Last | Next >
  • 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 Customer New 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!!!! Alex Los 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. GP Hesperia, CA
  • I couldn't be more satisfied! This is the site I will always come to when I need a second opinion. Justin Kernersville, 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. Esther Woodstock, 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. Robin Elkton, Maryland
 
 
 

Meet The Experts:

 
 
 
  • jstinehelfer

    Information Systems Manager

    Satisfied Customers:

    36
    A+ Comptia Certified computer repair
< Last | Next >
  • http://ww2.justanswer.com/uploads/JS/jstinehelfer/2012-6-6_215146_Pictureofme1.64x64.png jstinehelfer's Avatar

    jstinehelfer

    Information Systems Manager

    Satisfied Customers:

    36
    A+ Comptia Certified computer repair
  • http://ww2.justanswer.com/uploads/JA/JasonJames122/2011-12-16_135647_jasonjamesheadshotweb.64x64.jpg JasonJames122's Avatar

    JasonJames122

    Computer Enthusiast

    Satisfied Customers:

    0
    I manage all information systems (network of Windows PC's and servers with Microsoft Office products) for a small business
  • http://ww2.justanswer.com/uploads/JE/jessmagz/2012-6-6_18129_jm.64x64.jpg Jess M.'s Avatar

    Jess M.

    Computer Support Specialist

    Satisfied Customers:

    301
    Computer Software Specialist for more than 10 years
  • http://ww2.justanswer.com/uploads/CH/chutz747/2011-11-6_14231_me.64x64.jpg The-PC-Guy's Avatar

    The-PC-Guy

    Computer Manager

    Satisfied Customers:

    274
    20 years experience providing remote computer support
  • http://ww2.justanswer.com/uploads/SP/spherrod/2012-6-6_174244_1000852.64x64.JPG Steve Herrod's Avatar

    Steve Herrod

    Computer Support Specialist

    Satisfied Customers:

    125
    Trained in Microsoft Office from 2000 through to latest version 2010.
  • http://ww2.justanswer.com/uploads/SE/Seashore2011/2011-12-6_33418_111205223015.64x64.jpg Chris L.'s Avatar

    Chris L.

    Support Specialist

    Satisfied Customers:

    124
    Certified Expert with over 10 years experience.
  • http://ww2.justanswer.com/uploads/KR/krkljatorm/2012-6-24_153417_ITMiro.64x64.jpg IT Miro's Avatar

    IT Miro

    Computer Scientist

    Satisfied Customers:

    97
    Bachelor's Degree in Information Technology, Microsoft Certified Professional
 
 
 

Related Microsoft Office Questions