Button ghosts... click it works... click again it doesn't work

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

What I try to do is make my addnew subform visible on click...

Private Sub Kommandoknapp74_Click()
If Me.Kommandoknapp74.Caption = "New Call" Then
Me.Underobjekt73.Visible = True
Me.Kommandoknapp74.Caption = "Save"
Else
Me.Underobjekt73.Visible = False
Me.Refresh
Me.Kommandoknapp74.Caption = "New Call"
End If
End Sub

Now, the first time it makes it visible, it's an empty form ready for input.
Click again it saves the new data/record and nicely adds to the list below.
Click on New Call again and it shows the existing records... so not an
addonly form...
What simple thing am I doing wrong again?

Thanks for sharing your skills
Ben
 
Ben,

If you want a new data entry form, use Me.Underobjekt73.DataEntry=True.

Regards,
Graham R Seach
Microsoft Access MVP
Sydney, Australia
 
Thanks for the answer from wonderfull Sydney, but it doesn't seem to work.
In my properties of the subform, I had already put it on allowAdditions =
true and all the others on False... so no edit, no deletions. And I believe
that Me.Underobjekt73.DataEntry=True would do just that, right ?

On opening the form, it works and then you can record the call but suppose
that you would click again on it... it should reset the subform to an empty
addnew.. Hmmm, it could also just not show it again...
Is it easier to fix the problem or to just add a 3rd factor to the click
function which will hide it and replace by a text (you just created a new
call for this doctor!)
If so, how to add a 3rd factor to code below ?

Thanks again
 
Ben,

Sorry, that should have been:
Me.Underobjekt73.Form.DataEntry=True

Regards,
Graham R Seach
Microsoft Access MVP
Sydney, Australia
---------------------------
 
Back
Top