Josh,
Don't fret...you'll get it.
In the property sheet you can enter a Macro name, Function Name or choose
[Event Procedure]. [Event Procedure] runs the code behind the form for that
event.
In the property sheet, next to OnClick, you choose [Event Procedure]. Then
click on the Ellipsis (3dots) and this will open the VBA Code editor.
Access begins the event procedure and places your curser within it. Paste
the text into the procedure and you're done. It should look something like
this:
Private Sub YourButtonName_Click()
Forms!frmNewFaculty!AddressID=Me!AddressID
End Sub
Good Luck,
Booker
Josh Sharpe said:
Okay so I created two quick bound forms the first one has a button to open
the second one. The second one has a button with the code you gave me in
the onClick event.
I'm getting the following error when i click the button on the second form:
*
Microsoft Access can't find the macro
'Forms!frmNewFaculty!AddressID=Me!AddressID'
*
Basically - I have no idea what I'm doing.
-Josh
Josh,
In fact, it does get more simple than that. I my opinion, bound
forms
and
controls are simpler than unbound for several reasons. One reason
is
that
you won't have to worry about using queries to insert or update records.
After all, that's what Access is designed to do for you. Unless you have
a
good reason to use unbound forms, I'd suggest letting Access do the work
for
you.
If the first form is unbound, you should not get the 'not updateable'
error.
An unbound textbox (one having a blank controlsource property) is always
updateable and that error usually is referring to whether the form's
recordsource is updatable. An unbound form (blank recordsource property)
has no recordsource.
My suggestion is for bound forms and controls. Using SQL to lookup
the
ID
and again to update the field, then again the redisplay the values
on
the
first form is the only way to do it on an unbound form. Seems like
a
lot
of
work. Especially when Access does it faster and more accurately by itself
if you simply use bound forms.
HTH,
Josh
The form is unbound, the field is unbound and I use a query to update
with.
I'm not sure if it gets more simple than this. I'm also not sure what
info
you need to help answer it. So let me know and I'll be glad to answer.
-Josh
Josh,
If you are using Access db table (not SQL) and the PK is an autonumber
field, the autonumber is generated before the record is saved. Access
inserts the record after the first letter is typed into any