Thread: Advice
View Single Post
  #2 (permalink)  
Old February 10th, 2006, 08:48 AM
mmcdonal mmcdonal is offline
Friend of Wrox
Points: 9,611, Level: 42
Points: 9,611, Level: 42 Points: 9,611, Level: 42 Points: 9,611, Level: 42
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
Join Date: Mar 2004
Location: Washington, DC, USA.
Posts: 3,069
Thanks: 0
Thanked 10 Times in 10 Posts


1. You can compare the two dates using "DateDiff". You may want to doa search on this to see the syntax. Basically its:

If DateDiff("d", [StartDate], [EndDate]) > 0 Then
End If

If you are putting it into a query, you can add a column by entering the DateDiff formula in the row source:

Flag: DateDiff("d", [StartDate], [EndDate])

Then run your flag off this field.

2. Create a combo box that looks up the values you want to use to pass to your forms. Then grab that value and either pass them to a form, or check them and open the proper forms. That might look like:

Button_Click event
Dim inValue As Integer
Dim stLink As String
Dim stDocName As String

If IsNull(Me.ComboBox) or Me.ComboBox = "" Then
   'error message
   inValue = Me.ComboBox 'assumes PK is numeric
End If

'Then check the value against records if you want to open a particular form, then pass the DocName and run a DoCmd to open your form or report.

3. Can you post more data on the excel to access issue? Basically you deconstruct the pivottable (matrix) such that:

Person Jan06 Feb06 Mar06 etc
Tom 1 2 1
Joe 3 1 1
Mark 1 2 3


Person Month Value
Tom Jan06 1
Tom Feb06 2
Tom Mar06 1
Joe Jan06 3


BTW, please post in Microsoft Office>Access VBA

Reply With Quote