opening blank form upon open

  • Thread starter klp via AccessMonster.com
  • Start date
K

klp via AccessMonster.com

I know how to do code to start a blank form to open to a new record but what
I need is for it to open up to a blank record, be able to click on new and
enter data. If I open it to a new record and click on new it will burn up a
number. Our users like to be able to click on a 'new' button upon entering in
data as opposed to just starting to enter information. This could cause
confusion and then we'll have numbers that don't have any data. What is the
best way to go about this?

Kim P
 
J

John W. Vinson

I know how to do code to start a blank form to open to a new record but what
I need is for it to open up to a blank record, be able to click on new and
enter data. If I open it to a new record and click on new it will burn up a
number. Our users like to be able to click on a 'new' button upon entering in
data as opposed to just starting to enter information. This could cause
confusion and then we'll have numbers that don't have any data. What is the
best way to go about this?

Kim P

I'd suggest having the "New Record" button go to a new record only if you're
not already ON the new record:

Private Sub cmdNewRecord_Click()
If Not Me.NewRecord Then
DoCmd.GoToRecord acForm, Me.Name, acNewRecord
End If
End Sub

They can still click the button but it won't do anything except make them feel
as if they were doing something useful (and put some wear on the mouse
button).
 
K

klp via AccessMonster.com

Great thank you that worked. Now another question. Because my ID field is a
bound field I can't go in and just select a test from the drop down list. Do
I need to make my combo box an unbound field?

So I want to be able to open up the form to a blank record as I described
below, which that works. Then if I don't want to enter in a record right off
but select one from the drop down list or search for one through a search
button I can do that. Right now I cannot because my cbo box is bound. What do
I need to do?

Also in my search button, it will bring up another form, I can select several
things whether it's by item, vendor etc and then it will display the results
in a subform. I should be able to then select which one I want click on
select and it should copy it back to my main form. However that is not
working either. Assuming because of my bound control.

Thanks
Kim P
I know how to do code to start a blank form to open to a new record but what
I need is for it to open up to a blank record, be able to click on new and
[quoted text clipped - 5 lines]

I'd suggest having the "New Record" button go to a new record only if you're
not already ON the new record:

Private Sub cmdNewRecord_Click()
If Not Me.NewRecord Then
DoCmd.GoToRecord acForm, Me.Name, acNewRecord
End If
End Sub

They can still click the button but it won't do anything except make them feel
as if they were doing something useful (and put some wear on the mouse
button).
 
J

John W. Vinson

Great thank you that worked. Now another question. Because my ID field is a
bound field I can't go in and just select a test from the drop down list. Do
I need to make my combo box an unbound field?

That, or add another combo box just for searching; it does indeed need to be
unbound.
So I want to be able to open up the form to a blank record as I described
below, which that works. Then if I don't want to enter in a record right off
but select one from the drop down list or search for one through a search
button I can do that. Right now I cannot because my cbo box is bound. What do
I need to do?

Unbind the combo box or add a new search-only combo box.
Also in my search button, it will bring up another form, I can select several
things whether it's by item, vendor etc and then it will display the results
in a subform. I should be able to then select which one I want click on
select and it should copy it back to my main form. However that is not
working either. Assuming because of my bound control.

Post your code.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top