Disabled New Record

atrapp

New member
Local time
Today, 15:22
Joined
Aug 24, 2004
Messages
7
Hello all,

I have an application that shows 3 forms, 1 with 2 subforms and 2 standard single record forms. The New Record button for one of the single record forms is disabled and I can't figure out why. None of my colleagues have been able to help. Does anyone know why this might happen? I've tried compacting the database, adding a Me.AllowAdditions = true to the form. No luck. My users can't use the app if they can't add new data to the database!!!!!!

Thanks in advance!
 
I'll try...

Here's the code behind the form:
************************************************
Option Compare Database

Private Sub ApplicationID_Change()
Dim strSQL As String
strSQL = "SELECT WorkTypeID, WorkType FROM [SAWorkType] WHERE (ApplicationID = " & Me.ApplicationID.Value & ") ORDER BY WorkType"
Me.WorkTypeID.RowSource = strSQL
Me.WorkTypeID.Requery

If Me.ModeOfReceiptID.Value = DLookup("[ModeOfReceiptID]", "SAModeOfReceipt", "[ModeOfReceipt] = 'Magic Ticket'") Then
Me.Magic_Ticket.Visible = True
Else
Me.Magic_Ticket.Visible = False
End If
End Sub

Private Sub BtnAllRequests_Click()
Me.RecordSource = "SELECT * FROM [SALog] ORDER BY ID"
Me.Requery

End Sub

Private Sub BtnPending_Click()
Me.RecordSource = "SELECT * FROM [SALog] WHERE (AdminID = " & DLookup("[AdminID]", "VW_CurrentUser", "[Tag] = 'X'") & ") And (StatusID = " & DLookup("[StatusID]", "SAStatus", "[Status] = 'Pending'") & ") ORDER BY ID"
Me.Requery
End Sub

Private Sub BtnClosed_Click()
Me.RecordSource = "SELECT * FROM [SALog] WHERE (AdminID = " & DLookup("[AdminID]", "VW_CurrentUser", "[Tag] = 'X'") & ") And (StatusID = " & DLookup("[StatusID]", "SAStatus", "[Status] = 'Closed'") & ") ORDER BY ID"
Me.Requery

End Sub

Private Sub Form_Current()
ApplicationID_Change
If Me.CopyFlag.Value Then
Me.CopyFlag.Value = False
Me.CopyLabel.Visible = True
Else
Me.CopyLabel.Visible = False
End If
End Sub
Private Sub BtnDuplicateRecord_Click()
On Error GoTo Err_BtnDuplicateRecord_Click


DoCmd.DoMenuItem acFormBar, acEditMenu, 8, , acMenuVer70
DoCmd.DoMenuItem acFormBar, acEditMenu, 2, , acMenuVer70
DoCmd.DoMenuItem acFormBar, acEditMenu, 5, , acMenuVer70 'Paste Append


Me.CopyFlag.Value = True
Me.CopyLabel.Visible = True

Exit_BtnDuplicateRecord_Click:
Exit Sub

Err_BtnDuplicateRecord_Click:
MsgBox Err.Description
Resume Exit_BtnDuplicateRecord_Click

End Sub

Private Sub ModeOfReceiptID_AfterUpdate()
ApplicationID_Change
End Sub
**********************************************************
I'm not sure how to show the design of the form in this forum. Pleas let me know if you need more info...thanks!
 
My initial reaction on reading your post was this: In the properties window of the form, data tab, there is a property called "Allow Additions". Having this property set to 'No' will create the behaviour you described.

Reading your post all the way through, I saw that you tried putting 'Me.AllowAdditions = True' in the code, and figured you had checked this property also. I wanted take a look at the database, the controls, properties, events, etc. and mull this problem over.

If you take the .mdb file, and zip it up in winzip, it might be small enough to upload here as an attachment.

If that's not possible, then double check the allow additions property, or try putting 'me.allowadditions = true' in an event guaranteed to fire immediately, like onload.
 
Here it is..

A few things to note:
  • Yes, I did check the Allow Additions property on the form and it was set to 'Yes' AND I tried adding Me.AllowAdditions=true to the code to no avail. I can't remember which event I tried it in so I'll try OnLoad.
  • I am using an .adp file, which may or may not make a difference
  • I'm thinking that maybe the integrity settings on the record source table may be out of whack (e.g., bad index settings; bad identity settings). I'll look at that also.

Thanks for your help!
AT
 
Trying again...I don't see it...

The file was too large so I had to delete about half the forms. The form that's showing a disabled New Record button is SA Log.

Thanks for all your help!

AT
 

Attachments

I Fixed It!!!!

Mod,

See the 'Here it is...' post. It WAS that the index was not set on the underlying table. :rolleyes: Argh! Such a simple fix that took me 2 days to find! But I found it and that's all that counts, right??? ;)

Thanks for all your help! :D

AT
 

Users who are viewing this thread

Back
Top Bottom