Thursday 30 April 2009

Inputting a date and producing a report from it.

OK, so this one's a little complex.

Imagine. You have a query which requires you to enter something into a parameter - like a date or something. That query is then used to generate a report. But you'd like the search criteria you entered into the box to go on the report.

So, say there's a list of appointments for a particular day for a dentist or whatever. It would make sense to put the date the appointments are for on the report.

Step 1 - First create a form:

The entire purpose of this form is to enter a date (or two dates, or whatever you're searching for).
  • You need a textbox (and it must be a textbox!) on the form to type the date into.
  • Right click on the textbox and go into the properties. Change the name of the textbox to txtDate (or something similar).
  • Save the form as something like frmGetDate

Step 2 - Next you need a query:

Say to list the appointments someone has on that a day.

Like this:
BUT – instead of using a standard parameter criteria in the date column ([Enter the date] say) you type:

[forms]![frmGetDate]![txtDate]

What this does is put the date you enter in txtDate on frmGetDate into the parameter search. Clever eh? Like this:

But, if you run the query it won’t play. There are good reasons for this.

Step 3 - Create a report based on the query:

Just use a wizard for now, you can go back and work on this later.

Step 4 - Now the clever bit:

What you have to do is run the report from the form.

So go back to the form and put a Command Button in it which runs the query – you do this under Report Operations.

This should work – but it won’t show the date you typed into the textbox on the report. Yet.

Step 5 - The other clever bit:

What you need to do is go back to the report in Design view.

Create a textbox on the report somewhere – probably best to put it in the header of the report by the way

Right click on it and in the Data tab you need to type:

=Forms!frmGetDate!txtDate

into the control source box. Like this:

Step 6 - Now, try it out:

Open the form, hit the button and see what goes on!!This is a bit tricky of course, but you should be able to get there.

There’s no reason why you can’t enter two dates in the form – just give them different names (like txtDateStart and txtDateFinish). You could then stick two dates into the query using these names and then the report. Logically.

There’s also no reason why you couldn’t use a calendar control or spinners to populate the textboxes on the form for that matter – you could also set default values and/or input masks on the form (right click and properties) of course.

Total amounts of well coolness.

Tuesday 28 April 2009

Blanking Stuff on Forms

You have a form. You want the user to do stuff on it but there are some records you need the user to not be able to change. How good would it be to be able to blank those fields so that the user couldn't change them (and, while they're at it, screw the entire database up...)?

Quite easy.
  • Get the form in design view and select the field you want to stop the user changing
  • Click the Properties button
  • Find the Enabled property. It'll say Yes. Bet you can't guess what comes next?
  • Change the enabled property to No (I bet you got that right...)
Now run the form and check it works!

Wednesday 8 April 2009

97% of e-mail...

...is spam according to a Microsoft security report.

Apart from getting in the way and being generally annoying, there's an increasing rate of attachments along with all the joyous security concerns.

Out of every 1000 machines the report suggests that 8.6 are infected with a virus or malware of some kind. Interesting geographical distribution whilst we're at it:

Used in Spam overwhelms e-mail messages on the BBC website. Image originally produced by the lovely, lovely people at Microsoft...

I'd say that suggests to be careful of anything coming out of Russia and Brazil.

All the more reason to do the things which should be standard: decent anti-virus; update regularly; employ service packs; check for malware and spyware. Oh, and just don't open attachments or download stuff from sites without checking them first.
(The report) found that Office document attachments and PDF files were increasingly being targeted by hackers.

From: Spam overwhelms e-mail messages, BBC website
As I've said before, the number of people who simply don't seem to be aware they have to do this stuff always baffles me. But, you know, keep on downloading and adding friends on msm. Nothing bad can come of that...

Playstations, Xboxes and Wiis

My gaming experience is, let's say, "limited".

But never mind that - it seems that Playstations are outselling Wiis a little in Japan just now. Which might be interesting, it might not be, depending on whether it keeps up that way.

The Wii should, I imagine, recover as it hits a different market - the non-gaming market, the parents and kids market. Like, we have one. The 4 year old loves it.

But then I suppose you only need one Wii in a household whereas Playstations have gone through more generations and, presumably, you need multiple bits and pieces as well as upgrading?

Or do you? I don't really get that bit.

Oh, X-boxes are much less popular. But that might be the Japanese market?

Tuesday 7 April 2009

Your mum on Facebook?

This kinda made me laugh more than anything when I first saw it.

Stanford University is running classes in how to use Facebook - for parents.

Stanford is a top class uni by the way, this isn't some local community college running a class. The class (which is also a research project interestingly) deals with the Six Stages of Facebook Mastery amongst other stuff.

There is a serious side (other than the research bit) of course, connected to internet safety, the longer term risks of publishing those oh so funny photos (err, job application time anyone?) and whathaveyou.

Shouldn't Facebook be private though? Should your mum be able to have a handle on what you're saying online? Hmm...
Some parents worry about joining Facebook because they don’t want to intrude on their child’s privacy. They see it as spying in their kid’s bedroom. This view -- Facebook as private bedroom -- is not accurate. This is not a good way to think. Why not?

#1 - Strangers don’t enter a kid’s bedroom. But on Facebook, kids can interact with strangers.

#2 - In a bedroom, acts are not observable by hundreds of people. In contrast, what your child does on Facebook is widely observable.

#3 - Finally, what goes on in a bedroom is not recorded online, potentially forever, as it is on Facebook.

In short, we believe that if you view “Facebook as private bedroom” you will make mistakes in parenting.

From Facebook for Parents
Interestingly a group of parents came up with a list of 10 "commandments" for Facebook users. I wonder what you think of it:
1. “Friend” your family members on Facebook. If your child won't friend you, have at least one parent/guardian friend your child.

2. Teach your family about privacy settings. Discuss settings often.

3. Help loved ones think about the ramifications of posting & tagging photos.

4. Use Facebook so you understand it.

5. Turn "questionable actions" you see by others on FB into teachable moments for your family.

6. Help loved ones protect reputation by teaching that everything on FB is potentially public.

7. Look at the Facebook Walls of family members.

8. Review privacy settings monthly & share what you are doing with your family.

9. Help loved one see that FB is a public place where strangers can visit.

10. Talk often about FB with your family.

From: Facebook for Parents, Top 10 Ways to Protect Your Family on Facebook
My mum's not on Facebook though. And I should think that if she was I'd be looking to migrate to the next cool thing in social networking. Tweet anyone?