Kamis, 10 Mei 2012

Re: [MS_AccessPros] Table not being updated

 

Hi John
 
The control source is shop (ie the shop field in the main table)
 
I don't understand what you mean I'm afraid.
 
I fill in the company field and then tab to the shop field and drop down the options - the options displayed are the correct ones based on the value in the company field  -  so my question is what do you mean by 'you should requery in the after update event of the company combo'? What purpose does this serve? It seems that the query is running as it should so what is the value of querying? (I understand what you are suggesting |I do but why will this help?)
 
I don't know what 'the current event of the form' means. But if requerying at this point will solve my problem I will happily do that.
 
Sorry to be a bit thick on this - but if you could explain further I would appreciate it.
 
cheers
 
Phil


________________________________
From: John Viescas <JohnV@msn.com>
To: MS_Access_Professionals@yahoogroups.com
Sent: Thursday, 10 May 2012, 19:28
Subject: RE: [MS_AccessPros] Table not being updated


 

Phil-

What's the Control Source of the "Shop" combo? I bet it's blank. And you
should Requery the shop combo in the AfterUpdate event of the Company combo and
the Current event of the form to keep everything in sync.

John Viescas, author
Microsoft Office Access 2010 Inside Out
Microsoft Office Access 2007 Inside Out
Building Microsoft Access Applications
Microsoft Office Access 2003 Inside Out
SQL Queries for Mere Mortals
http://www.viescas.com/
(Paris, France)

------------------

From: MS_Access_Professionals@yahoogroups.com
[mailto:MS_Access_Professionals@yahoogroups.com] On Behalf Of pdk444444
Sent: Thursday, May 10, 2012 7:25 PM
To: MS_Access_Professionals@yahoogroups.com
Subject: [MS_AccessPros] Table not being updated

 
Hi

2 of my tables are called company and shop.

I have a table (I'll call it Main) which has many fields, 2 of which are called
company and shop and these 2 fields lookup from the 2 tables.

I know that you guys hate lookups but this is what I have !!!!

I then have a form based on the main table.

The field 'company' on this form uses the lookup defined in the table to drop
down a list of companies for the user to choose from.

What i then want is for the field 'shop' to drop down a list of shops which is a
subset of all shops based on the entry in field 'company'

To achieve this I have a query which uses forms!main!company as the criteria and
I use this in the rowsource property of the shops field.

When entering a 'main' record all seems fine and the correct shops for the
company entered are displayed in the drop down list and when the user selects a
shop it is displayed in the field.

However, the value for shop is not then stored in the main record and of course
I want it to be.

Can someone please tell me why and whether there is something I can do to
achieve this?

cheers

Phil

I have a form where one of the fields drops down a list which is based on a
query which is dependent on the value entered in another field.

The correct list

[Non-text portions of this message have been removed]

__._,_.___
Recent Activity:
.

__,_._,___

Tidak ada komentar:

Posting Komentar