Access closes when activating vba code



I have a weird problem that I'm trying to solve but can't seem to find
a solution at this time. My Access database closes completely when the
"Else" of the VBA code is applicable.

I'm running Access XP Pro (2002) french on WinXP
Form: frm_commande (data coming from Qry_Commande)
Subform: sfrm_commande_detail

The following VBA code is running on Form_Current event of the subform.
All the fields used in the code are in the footer of the subform and I
created a two dummy text fields to help get the data. These data are
not saved in any tables, they are just used to calculate information.

Dummy 1 - Date_Facture which equals the Date_facturation field of the
form (I tried using the field of the form directly but I get the same
result).

Dummy 2 - TauxTPS which is used to get the dynamic rate that will be
used to calculate the proper tax amount according to the date.

Me.Refresh
If (IsNull(Me.Date_Facture)) Or Me.Date_Facture = " " Then
Exit Sub
Else
Me.Refresh
If Me.Date_Facture < Me.Date_juillet Then
Me.TauxTPS.ControlSource = "=0.07"
Else
Me.TauxTPS.ControlSource = "=0.06"
End If
End If

As soon as I have data in the Date_Facture field which is a core data
to establish the rate, the Access database closes completely... no
error message nothing. Tried to compact and repair the DB... still no
success. Anybody has an idea???

.



Relevant Pages

  • Re: Unable to Step Into Access VBA Code
    ... I am unable to Step Into the VBA code from the ... forms or reports in the Design mode. ... I am Administrator on this Access database but unable to Step Into the VBA ... The code will stop at the breakpoint. ...
    (microsoft.public.access.modulesdaovba)
  • Re: Form SubForm..
    ... I have a subform based on a query of linked tables using ... >> My mainform is based on tblMembers as stated below. ... is a small Access database ...
    (microsoft.public.access.forms)
  • Re: Converting VBA project to .net
    ... or VBA code in VB.NET project ... Microsoft GTSC Developer support for Middle East ... "Sam Johnson" wrote in message ... > I've got the following problem: I developed a VBA based access database ...
    (microsoft.public.access.formscoding)
  • Re: Converting VBA project to .net
    ... or VBA code in VB.NET project ... Microsoft GTSC Developer support for Middle East ... "Sam Johnson" wrote in message ... > I've got the following problem: I developed a VBA based access database ...
    (microsoft.public.dotnet.general)
  • Re: I need to Sum a calc. control in subform and show in main form
    ... is a small Access database ... I have a main form called Customers that has info such as phone, ... Then a subform called orders which has shipping and tax info and the ... I currently the order details subform calculate the exact price of each ...
    (microsoft.public.access.forms)