What I was looking for was when you click on the ellipsis, is the cursor in
the VB Editor inside of the block of code
Private Sub cmdAddOne_Click()
Me!Netting = Nz(Me!Netting, 0) + 1
End Sub
or is it somewhere else? If it's not inside that block of code, is it inside
another block of code?
BTW, to add a message box, change what you've got to
Private Sub cmdAddOne_Click()
MsgBox "Inside of cmdAddOne_Click"
Me!Netting = Nz(Me!Netting, 0) + 1
End Sub
--
Doug Steele, Microsoft Access MVP
(no e-mails, please!)
becky250 said:
Yeah, it takes me to "TS Database - Form_Example of click on netting
(Code)"
and the code/command is at the very top of the Page. There are properties
on
the left hand side that say Plus 1 for Netting CommandButton and it shows
that on the 'OnClick' there is [Event Procedure]. The formula is still at:
Private Sub cmdAddOne_Click()
Me!Netting = Nz(Me!Netting, 0) + 1
End Sub
Thanks for your prompt responses.
:
You say you've got [Event Procedure] as the value for the On Click
property.
If you click on the ellipsis (...) to the right of that, where in the VB
Editor are you taken?
--
Doug Steele, Microsoft Access MVP
(no e-mails, please!)
Is it maybe something to do with how the button is linked to the
command?
The
textbox commands seem directly linked i.e the command is preceded by
the
name
of the box but the button doesnt seem to be connected to the 'add one'
command.
:
Its definitely on "On Click: Event Procedure" for the button and I
copied
the
formaula exactly. Im not sure how to add a message box sorry, tried to
Google
how to do this also to save you having to go through it but couldnt
find
an
answer.
Regards
:
You sure that the Click event is firing? Is the Click property set
to
[Event
Procedure]?
If it is, put a message box inside the event to see whether it
actually
is
firing.
--
Doug Steele, Microsoft Access MVP
(no e-mails, please!)
That works absolutely brilliantly for the double click, thank you!
Exactly
what i was looking for. The button however still doesnt work, this
is
what
i
have:
Private Sub cmdAddOne_Click()
Me!Netting = Nz(Me!Netting, 0) + 1
End Sub (this is set to a command button, in a the click event
procedure,
code builder etc)
Private Sub Netting_DblClick(Cancel As Integer)
Me!Netting = Nz(Me!Netting, 0) + 1
End Sub (this is set to the textbox 'Netting')
Is there anything im missing? Also, would it be possible to have a
'Minus
1'
button just using - 1? Thanks again.
:
Private Sub cmdAddOne_Click()
Me!Netting = Nz(Me!Netting, 0) + 1
End Sub
--
Doug Steele, Microsoft Access MVP
(no e-mails, please!)
This doesn't seem to be working though im not sure if ive
edited
it
correctly. I have
Private Sub cmdAddOne_Click()
Me!Netting = Me!Netting + 1
End Sub
where the text box is called Netting. Nothing happens though
when
the
button
is clicked. I also tried it for the double click action on the
textbox
but
couldnt get this to work either. Would I need something which
made
all
the
entries in a new record default to 0 so that the command could
plus one
to
that? Access is harder than it first appears!
Regards
:
On Fri, 19 Jun 2009 09:21:03 -0700, becky250
Sorry, really silly question, where can i put this coding? I
will try
it
out,
it sounds about right.
Open the form in design view. Select (or create) the command
button.
View
its
Properties; on the "Events" tab one of them is the Click
event.
Click
the
...
icon by that property and choose "Code Builder". Access will
open
the
VBA
editor and give you the appropriate Sub and End Sub lines for
free.
Just
edit
the one line in between (using your actual control name of
course).