By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,852 Members | 1,014 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,852 IT Pros & Developers. It's quick & easy.

Open form as Data Entry with Customer Info

P: n/a
I am learning with a simple application/form. I am ok - enter customer
name, list box of customers, select a customer, see the items for that
customer.

The items form has customer ID and Name in the header; details on
continuous form in detail.

I want to press a button "Add Garment" and open the customer item form
with the customer ID and Name from the view of the form, but open it as
Data Entry so the user can add garments.

I can't get the Customer ID and Name on the form when I open it for DE.

If this is the wrong design, please advise. I am wondering if it's a
problem that I want to open the same form in DE mode from the form in
view mode.

Here's the code:

Private Sub cmdAddGarment_Click()
'Once the user found the customer and saw items on file, needs to
add an item
' Open the frmItems in DataEntry mode for this customer

Dim CustID As Long
Dim stDocName As String
Dim First As String
Dim Last As String

Dim stLinkCriteria As String

CustID = Me.CustID
First = Me.FirstName
Last = Me.LastName

stDocName = "frmItems no sub"

stLinkCriteria = "lngCustID = " & CustID & "txtCustomer = " & First
& " " & Last

' Want to open the frmItems to allow Entry
DoCmd.OpenForm stDocName, , , stLinkCtiteria, acFormAdd
Me.DataEntry = True
Me.AllowAdditions = True
Me.AllowEdits = True

( I got some hints from these groups - maybe I'm mixing things I
shouldn't?)

thanks
Sara

Nov 13 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
Normal way to do this is to have a table of customers, a table of garments
and a table to join the customer to the garments

You then have a form for the customer, with a list or combo box to get to
the correct customer, and a subform for the garments they have bought. You
simply add a new record on the subform for a new garment. No coding
required.

Phil

"sara" <sa*******@yahoo.com> wrote in message
news:11**********************@f14g2000cwb.googlegr oups.com...
I am learning with a simple application/form. I am ok - enter customer
name, list box of customers, select a customer, see the items for that
customer.

The items form has customer ID and Name in the header; details on
continuous form in detail.

I want to press a button "Add Garment" and open the customer item form
with the customer ID and Name from the view of the form, but open it as
Data Entry so the user can add garments.

I can't get the Customer ID and Name on the form when I open it for DE.

If this is the wrong design, please advise. I am wondering if it's a
problem that I want to open the same form in DE mode from the form in
view mode.

Here's the code:

Private Sub cmdAddGarment_Click()
'Once the user found the customer and saw items on file, needs to
add an item
' Open the frmItems in DataEntry mode for this customer

Dim CustID As Long
Dim stDocName As String
Dim First As String
Dim Last As String

Dim stLinkCriteria As String

CustID = Me.CustID
First = Me.FirstName
Last = Me.LastName

stDocName = "frmItems no sub"

stLinkCriteria = "lngCustID = " & CustID & "txtCustomer = " & First
& " " & Last

' Want to open the frmItems to allow Entry
DoCmd.OpenForm stDocName, , , stLinkCtiteria, acFormAdd
Me.DataEntry = True
Me.AllowAdditions = True
Me.AllowEdits = True

( I got some hints from these groups - maybe I'm mixing things I
shouldn't?)

thanks
Sara

Nov 13 '05 #2

P: n/a
I have those tables, but since there are so many lookups, I thought it
would get confusing for the user to always see drop down boxes. Also,
any typing the user does is automatically changing the data - which is
a problem for a novice user, accidentally typing in the wrong place.

I wanted to have the user see what was on file, and choose "ADD" after
confirming that the garment coming in for tailoring was not already on
file for the customer.

Is my idea totally off? How do you prevent the user from accidentally
over-typing a good record with info for a new record?

(As you can tell, I really AM new!)
Thanks,
Sara

Nov 13 '05 #3

P: n/a
On both the form and the subform there are properties of AllowEdits,
AllowAdditions and AllowDeletions. If you normally have AllowAdditions set
to Yes (True) and the other 2 to No (False) then you could have a button to
change those 2 settings.
Remember though that on the Form.OnOpen and on the Form.OnCurrent to set the
AllowEdits and AllowDeletions back to No

Have fun
Phil
"sara" <sa*******@yahoo.com> wrote in message
news:11**********************@o13g2000cwo.googlegr oups.com...
I have those tables, but since there are so many lookups, I thought it
would get confusing for the user to always see drop down boxes. Also,
any typing the user does is automatically changing the data - which is
a problem for a novice user, accidentally typing in the wrong place.

I wanted to have the user see what was on file, and choose "ADD" after
confirming that the garment coming in for tailoring was not already on
file for the customer.

Is my idea totally off? How do you prevent the user from accidentally
over-typing a good record with info for a new record?

(As you can tell, I really AM new!)
Thanks,
Sara

Nov 13 '05 #4

P: n/a
OK. A little embarrassing here, but I think what I have to do is
either:
1. Put drop down boxes on the "view" items form and open the form as
data entry when the user presses "Add Garment" button
OR
2. Leave it as it is and create a form frmAddGarment and have that
open when the user presses "Add Garment".

Either way (I've tried both and don't have either working) - one
problem is getting the form to open with the customer name in the
header (txtCustomer). Also, I assume I have to carry over the Customer
ID for the record to be properly written?

Before I go too crazy here, maybe a suggestion on which way to proceed,
so I can work on one solution and ask focused questions on that.

Thanks - really, really!
Sara

Nov 13 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.