form/subform can't add new record?

D

David_Beginner

Creating New record in subform

Let me start by setting up the scenario as simply as I can. I believe it's
fairly typical...

4 tables:

tblclients [clientid][clientname][active]
tblorders [clientid][orderid]
tblorderdetails [orderid][productid]
tblProducts [productID]

3 Forms, embedded:

Forms Masterorder, Suborder1, suborder2

Form Masterorder has a one UNBOUND combo box which queries tblclients.
clientid,name,active.
The after update has the corresponding code

Private sub
Dim rs As Object
Set rs = Me.Recordset.Clone
rs.FindFirst "[ClientID] = " & Str(Nz(Me![Combo45], 0))
Me.Bookmark = rs.Bookmark
If Not rs.EOF Then
End Sub

Form Suborder1 queries tblOrders.clientid, orderid

Linkage between masterorder and ordersub1 is on clients.ClientID and Orders.
CientID

Form Suborder2 queries tblorderdetails.orderid and tblproducts.productid

Linkage between ordersub1 and ordersub2 is on tblorders.orderid and
tblorderdetails.orderid

Note, Before I created this form I had already entered orders for many
customers in a form, but the combo box could only select clients for new
orders, not lookup existing orders.
In this new form the combobox effectively looks up the order for every
customer that is selected in the combo box list.
However, if a customer is selected from the combo box and has no order, then
the subform is blank. Products can be addedin subform 2, but no order Id
will be established in either the orders or ordersdetail tables.
When I click new in the navigation bar and select a customer from the combo
box which has no order then still no new order id is established in the
orders table.
How can I create a new order for a new customer in this form, or can I?

If someone could point me in the right direction, I would really appreciate
it.

Thank you,

david
 
D

David_Beginner

Forgive me this is my first post.. I should add that clients.clientid and
orders.orderid are primary key and autonumber.
 
G

Graham Mandeno

Hi David

You do yourself no favours by replying to your own message several times in
quick succession with "?". Firstly it makes it look at first glance as
though someone has responded to your message and is helping you. Secondly
it gives the impression that you are impatient. This newsgroup is not
monitored by Microsoft. The answers are provided by unpaid volunteers who
live all around the world. When you first posted your question it was
either late Friday evening or early Saturday morning for many folks.

In any case, you cannot expect an immediate response here. Sometimes you
can be lucky, but often the turnaround time is up to 24 hours.

I see that Rick has answered your question when you reposted it yesterday.
If you have any further questions, feel free to post them and then wait
patiently :)
 
D

David_Beginner via AccessMonster.com

Hi Graham,

As mentioned it was my first post.
I mistakenly replied to myself immediately.
Fearing that it would appear resolved and passed over, as many posts after
mine were responded to, I tried to bring it to the forefront several times
w/ a simple ?.
Clearly that was a mistake and clearly it was mistaken for impatience, which
really wasn't the case.
All the help is much appreciated.
Thanks for your reply,

David


Graham said:
Hi David

You do yourself no favours by replying to your own message several times in
quick succession with "?". Firstly it makes it look at first glance as
though someone has responded to your message and is helping you. Secondly
it gives the impression that you are impatient. This newsgroup is not
monitored by Microsoft. The answers are provided by unpaid volunteers who
live all around the world. When you first posted your question it was
either late Friday evening or early Saturday morning for many folks.

In any case, you cannot expect an immediate response here. Sometimes you
can be lucky, but often the turnaround time is up to 24 hours.

I see that Rick has answered your question when you reposted it yesterday.
If you have any further questions, feel free to post them and then wait
patiently :)
Creating New record in subform
[quoted text clipped - 58 lines]
 

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