ardy
Registered User.
- Local time
- Yesterday, 21:24
- Joined
- Sep 24, 2012
- Messages
- 98
Hello All....
I have been working on a Access(2007) applet. All is going well with an exception of not being able to open one of my forms in normal mode(not an edit mode). It seems no matter what i do the form opens in edit mode. this is with the little pencil to the left( See EM.jpg). I need to open this form in normal mode or not edit mode the solid right pointed triangle (See NM.jpg). I have tried All I know but still nothing.....:banghead:
OK I know for you to help me you need to know the the code behind the button that opens the form....so here are the codes. Also please take into account that I am not a programmer by profession, but have managed to learn a lot from you guys through the years. any help is appreciated.....
Form Data Tab States....
Data Entry = No
Allow Additions = No
Allow Deletions = No
Allow Edits = No
The Click event that opens the form.....
On Click Event:
The form once opens has 3 Evens ( On Current, On Load and On Open) The code for each is below.
On Current:
On Load:
On Open:
I have been working on a Access(2007) applet. All is going well with an exception of not being able to open one of my forms in normal mode(not an edit mode). It seems no matter what i do the form opens in edit mode. this is with the little pencil to the left( See EM.jpg). I need to open this form in normal mode or not edit mode the solid right pointed triangle (See NM.jpg). I have tried All I know but still nothing.....:banghead:
OK I know for you to help me you need to know the the code behind the button that opens the form....so here are the codes. Also please take into account that I am not a programmer by profession, but have managed to learn a lot from you guys through the years. any help is appreciated.....
Form Data Tab States....
Data Entry = No
Allow Additions = No
Allow Deletions = No
Allow Edits = No
The Click event that opens the form.....
On Click Event:
Code:
'[FONT=Arial][SIZE=2] Open Access Agreement Information
Dim wel As String
Dim Agreement_ID As String
Dim WellLookup As String
Dim WellLookup1 As String
Dim APN_ As String
wel = Forms!Facility_Details!Well_ID
Agreement_ID = wel & "-" & Forms!Facility_Details!ID
APN_ = Forms!Facility_Details!APN
' ----------
WellLookup = Nz(DLookup("Access_Agreement_ID", "Access_Agreement", "Access_Agreement_ID = '" & Agreement_ID & "'"))
WellLookup1 = Nz(DLookup("ID", "Access_Agreement", "Access_Agreement_ID = '" & Agreement_ID & "'"))
' MsgBox "WellLookup= " & WellLookup & "WellLookup1= " & WellLookup1
If Agreement_ID = WellLookup Then
DoCmd.OpenForm "Access_Agreement", , , "ID = " & WellLookup1
Else
MsgBox "There is no Agreement for " & wel & vbNewLine _
& "Creating agreement Record "
' MsgBox wel ' For testing
DoCmd.OpenForm "Access_Agreement_NR", acNormal, , , acFormAdd, acWindowNormal
Forms!Access_Agreement_NR!Access_Agreement_ID = Agreement_ID
Forms!Access_Agreement_NR!Well_ID = wel
Forms!Access_Agreement_NR!APN = APN_
Exit Sub
End If[/SIZE][/FONT]
On Current:
Code:
[FONT=Arial][SIZE=2]' hide copy button when mail address is null
If Nz(Me!Mail_Address, "") = "" Then
Me!CmdCopy.Visible = True
Else
Me!CmdCopy.Visible = False
End If
Exit Sub[/SIZE][/FONT]
Code:
[SIZE=2][FONT=Arial]'update APN Field - Normalize empty Expire Date.
Dim APN As String
Dim Renwal_warning As Boolean
Dim DontNeedAccess As String
Dim Have_AA As Double
Dim Need_AA As Double
' Lookup to see if need to renew from hist table
Renwal_warning = DLookup("Renwal", "Access_Agreement_Hist", "[Access_Agreement_ID]='" & Forms![Access_Agreement]![Access_Agreement_ID] & "'")
DontNeedAccess = DLookup("Need_Access", "Access_Agreement_Hist", "[Access_Agreement_ID]='" & Forms![Access_Agreement]![Access_Agreement_ID] & "'")
' Need agreement Logic variable assignments
Have_AA = Me.Chk_HaveAA
Need_AA = Me.Chk_NeedAA
' MsgBox Have_AA & " --- " & Need_AA ' for testing
APN = Forms!Facility_Details!APN
Me.APN = APN
' Need agreement Logic
If Have_AA = -1 Then
Me.Chk_NeedAA = 0
End If
' ============================ Warning boxs messages
If Renwal_warning = True Then
Me.Txt_Warning.BackColor = 12695295
Me.Txt_Warning.FontBold = True
Me.Txt_Warning.FontSize = 11
Me.Txt_Warning = "Need To Renew Access Agreement"
Me.Chk_NeedAA = -1
Me.Chk_HaveAA = 0
Else
Me.Txt_Warning = ""
Me.Chk_NeedAA = 0
End If
If DontNeedAccess = "No" Then
Me.Txt_Warning2.BackColor = 12695295
Me.Txt_Warning2.FontBold = True
Me.Txt_Warning2.FontSize = 11
Me.Txt_Warning2 = "We Do Not Access This Property- No AA Needed"
Else
Me.Txt_Warning2 = ""
End If
' ============================= End Warning messages
' chack for null date to set the other dates to null
If IsNull(Me.Agreement_Start_Date) Then
Me.Agreement_Expire_Date = Null
Me.Agreement_Notice_Date = Null
Else
End If
Exit Sub[/FONT][/SIZE]
Code:
[SIZE=2][FONT=Arial]' Synching the APN. Make sure the APN in The facility detail is the same APN in AA form
Dim APN_AAform As Double
APN_AAform = Forms!Access_Agreement.APN
' Changing facility detail APN to the same APN in AA form
Forms!Facility_Details.APN = APN_AAform
Exit Sub
End Sub[/FONT][/SIZE]