Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / General 2 / January 2008

Tip: Looking for answers? Try searching our database.

MDE File

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Welthey - 13 Jan 2008 14:14 GMT
I am trying to create an MDE file and I'm getting an error on the following
code.  I'm getting a Complile Error on the following code.  I'm not quite
sure where to go from here.  Is the code not compatible with the MDE file.  
I'm new to Access so I am not sure what is really wrong.  Can some please
advise on how to proceed.  Thank you.

Private Sub Days_Out_Of_Compliance_BeforeUpdate(Cancel As Integer)
On Error GoTo Err_WorkingDays

   Dim intCount As Integer
   
   StartDate = StartDate + 3
   
   intCount = 0
   Do While StartDate <= EndDate
   
   Select Case Weekday(StartDay)
   Case Is = 1, 7
   intCount -intCount (I get the compile error on this line.)
   Case Is = 2, 3, 4, 5, 6
   intCount = intCount + 1
   End Select
   StartDate = StartDate + 3
   Loop
   WorkingDays = intCount
   
Exit_WorkingDays:
   Exit Function
   
Err_WorkingDays:
   Select Case Err
   
   Case Else
   MsgBox Err.Description
   Resume Exit_WorkingDays
   End Select
   
   End Function
   
End Sub
Stefan Hoffmann - 13 Jan 2008 14:20 GMT
hi Welthey,

> I am trying to create an MDE file and I'm getting an error on the following
> code.  I'm getting a Complile Error on the following code.  I'm not quite
> sure where to go from here.  Is the code not compatible with the MDE file.  
> I'm new to Access so I am not sure what is really wrong.  Can some please
> advise on how to proceed.  Thank you.
First check whether you have set Option Explicit, it should be the first
line in the module.

>     Select Case Weekday(StartDay)
>     Case Is = 1, 7
>     intCount -intCount (I get the compile error on this line.)
You have to assign the value to a variable, e.g.

  intCount = intCount - 123

mfG
--> stefan <--
Welthey - 13 Jan 2008 15:24 GMT
I'm not quite sure what that means.  Is that something that I need to type at
the beginning of the code?  Also I ran into another error at the
Me.cboBannerLabel, I'm going to assume that since it stopped at the first one
that all the rest of them.  Any ideas?

Private Sub cboBannerLabel_AfterUpdate()
       Me.txtReportName = DLookup("[Report Name]",
"[tblAMUDailyRptsMatrix]", "[Banner Label]='" & Me.cboBannerLabel & "'")
       Me.txtJobName = DLookup("[Job Name]", "[tblAMUDailyRptsMatrix]",
"[Banner Label]='" & Me.cboBannerLabel & "'")
       Me.txtQueue = DLookup("[Queue Data Goes In]",
"[tblAMUDailyRptsMatrix]", "[Banner Label]='" & Me.cboBannerLabel & "'")
       Me.txtDeliverTo = DLookup("[Deliver To]", "[tblAMUDailyRptsMatrix]",
"[Banner Label]='" & Me.cboBannerLabel & "'")
       Me.txtPrimaryContact = DLookup("[Primary Contact]",
"[tblAMUDailyRptsMatrix]", "[Banner Label]='" & Me.cboBannerLabel & "'")

> hi Welthey,
>
[quoted text clipped - 15 lines]
> mfG
> --> stefan <--
Stefan Hoffmann - 13 Jan 2008 16:04 GMT
hi Welthey,

> I'm not quite sure what that means.  Is that something that I need to type at
> the beginning of the code?  
Yes.

You may take a look at Tools/Options. There you can check
"Require Variable Declaration". When creating a new module of any type,
this will place the "Opition Explicit" at the first line if it.
Without this, any variable name, even it is a typo, will be accepted:

  Dim i As Integer

  i=100
  i=j+1
  MsgBox i

This is also a problem, when you refer to controls and rename them later.

> Private Sub cboBannerLabel_AfterUpdate()
>         Me.txtReportName = DLookup("[Report Name]",
> "[tblAMUDailyRptsMatrix]", "[Banner Label]='" & Me.cboBannerLabel & "'")
This looks fine. Place the Option Explicit into the first line of your
form module and run Debug/Compile.

mfG
--> stefan <--
Bob Quintal - 13 Jan 2008 15:18 GMT
> I am trying to create an MDE file and I'm getting an error on the
> following code.  I'm getting a Complile Error on the following
[quoted text clipped - 37 lines]
>    
> End Sub

what are you trying to do with the line intcount - intcount?
Right now its saying subtract intcount from itself, but you are not
assigning the result to anything, which gives the compile error, or
did you mean intcount = intcount, which is a waste of computer
cycles.  
Based on the rest of the code, just remove the line completely, it
is not necessary, you only need to test for saturday or sunday, and
do nothing if that is the case.


Signature

Bob Quintal

PA is y I've altered my email address.

--
Posted via a free Usenet account from http://www.teranews.com

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.