Access a mind of its own?

Makaveli

Access SMP
Local time
Today, 08:22
Joined
Jul 1, 2008
Messages
17
i dont know if this is a common problem with access, i've just posted a thread but i thought i'd keep this seperate as its another issue.

when i format a form and select "allow additions" and turn this value to "no" it allows me to view the form ok, but every now and then when i open it it has no data and is just a blank grey screen.

i go into design mode and then i have to change it back save it and repeat the process everytime access seems to think for itself. Im using access 2003.

the reason why im not allowing any additions, is so that the user can only edit data that is already there, or in another instance just search through the data.

is there another more stable way to do this? Maybe it likes to think for itself every now and then.... a little scarry artificial inteligence...it could be me the user though.

Thanks
 
It is probably the user.... (sad to say)

I think you are opening the form using a where or filter... Instead of just opening it.

There must be some "limiting" factor that is causing this other than this "allow additions" thing.
 
A form with AllowAdditions set to No will exhibit this behavior if there is no data in the underlying Recordset which, as the Mailman suggested, could be the result of a filter having been applied that returned no records.
 
reply

Thanks,
at least my form isnt going to go irobot on me lol.
theres no data in the tables yet i guess that was the problem.
AI pretty scary
 
As you've found out, having no data in the form's underlying recordsource presents a problem when you want AllowAdditons to be set at No, especially in a distributed database. You don't really want to have to explain to the users that they have to enter the first record directly in the table, so here's a hack I use. It checks to see if the recordset has any records in it; if it doesn't, AllowAdditions is set to Yes, otherwise it's set to No.

Code:
Private Sub Form_Load()
If RecordsetClone.RecordCount = 0 Then
  Me.AllowAdditions = True
Else
  Me.AllowAdditions = False
End If
End Sub
Code:
Private Sub Form_Current()
If RecordsetClone.RecordCount = 0 Then
  Me.AllowAdditions = True
Else
  Me.AllowAdditions = False
End If
End Sub
 

Users who are viewing this thread

Back
Top Bottom