Got it working, with a tweak or two and DUH, had to add some references in my tools.
Code follows
Option Compare Database
Option Explicit
Public Function Getwkdate(currentdate As String) As Date
Select Case currentdate
Case "Sunday" ' Sunday
Getwkdate = Date - Weekday(Date) + 1
Case "Monday"...
Currentdate is a bit of a misnomer I suppose. I culled it from some code I found elsewhere and never bothered to change it. What I am looking to get is, if the user selects Monday from the combo_box the query returns Mondays date, same for tues, weds, etc.
Here's the SQL from my Query. The tables routesbyday and routesbydriver each contain one half of our route table. Each day the routes change so I merge the two halves based on the day. As you can see I'm using it to represent a value in a query. This example is from the version I tried with your...
My new code looks as follows
------------BEGIN CODE
Option Compare Database
Option Explicit
Public Function Getwkdate(ByVal currentdate As String) As String
Dim returndate As String
currentdate = Format(Date, "dddd")
Getwkdate = currentdate
Select Case...
The actual query has it capitalized, I generally use the builder and point it to the function through that, less chance of typos. As for the passing a string, I have tried the code
Function Getwkdate(currentdate)
As well as
Function Getwkdate()
Dim currentdate As String
And both methods...
Any ideas as to why access is giving me the error that this function is undefined? It's entered as you see below and is compiled without errors.
---------------------BEGIN CODE
Option Explicit
Function Getwkdate()
Dim currentdate As String
currentdate = Getwkdate
Select Case currentdate...
Ok guys, I'm writing a query to bring together a number of different fields and values and append them all to a single table.
My query looks like this.
TableA TableB TableC TableD
Field1 Field1 Field1 Field1
Field2
Field3
Insert Into TableE (Cuid...
I will very likely be naming my first born after you. And might I say... DUH to me. I'd been SOOOOO wrapped up in the freaking limitations of the Query grid designer in Access I let a basic SQL query just slip past me. You've calmed my ulcers and saved my hair line. Many thanks and may the gods...
Ok guys here's the deal..
I'm designing an inventory transfer module.
In one table are the goods to be transferred.
In the other table is the list of goods sorted by inventory qty, bin and warehouse.
So table A:
Item# Desc Qty
DP01090 Tortilla 10
DP01011 Corn Chip 23...
Hey Gang,
I'm not writing some huge database here, not even really writing a good ammount of code in Foxpro, just have an issue that's hanging me up and I hope to get the down and dirty about it.
Here's the scenario. I work for a company that uses a pretty standard MS-SQL accounting...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.