query append with a custom function

wchernock

Registered User.
Local time
Today, 16:02
Joined
Jun 18, 2007
Messages
28
I have 2 tables (Tbl-ProjectList and Tbl-HoursForecast).

Tbl-ProjectList
project#
userid

Tbl-HoursForecast
project#
userid
week#
forecasthours

I have a form that displays the project list for a given userid. I am trying to write an append query to be run from a command button. The thought is that when I click the command button, it pulls up a new form that displays all of the projects for that employee and defaults to the current week so forecasts can be entered.

I built a query on the Tbl-ProjectList then made it an append query to append to the Tbl-HoursForecast. It seems to work well but I'd like to default the week# for each added record to the result of a custom function.

Any ideas?
 
If I was using the QBE grid (which I do) I would put the function in the query like:

MyNewFieldName:CustomFunction()

and then in the APPEND TO put the field that it's going to.

A very BIG IMPORTANT THING - Get rid of the # signs in the names. Do NOT use special characters (and preferably no spaces either) in object or field names. Your # signs are date delimiters and are reserved in Access so you can screw yourself up royally using them in names. The same goes for Access reserved words like DATE, WEEK, YEAR, etc.

You can use WeekNum or WeekNo but I would definitely get rid of Week #
 

Users who are viewing this thread

Back
Top Bottom