A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Database Design
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Table update



 
 
Thread Tools Display Modes
  #1  
Old August 25th, 2008, 05:04 PM posted to microsoft.public.access.tablesdbdesign
Jacques Steinman[_2_]
external usenet poster
 
Posts: 17
Default Table update

I have just realised that I have a problem with the way I set up my
master/detail form and table.

I used the following code in the "after update" of the column that items are
being selected from in the subform:

Private Sub d_itemid_AfterUpdate()

With Me.d_itemid
If Not IsNull(.Value) Then
Me.d_cost = .Column(3)
Me.d_eskpurch = .Column(5)
End If
End With

End Sub

Problem is, now when costs are updated in the product table it does not
automatically change on the already created entries in the detail table. It
only updates when the items are re-selected in the form.

I'm not very knowledgable wrt Access, so can anyone help me with this.
I don't want to change the tables as there are already thousands of entries
on the various tables in this database

Thanks in advance
  #2  
Old August 25th, 2008, 05:44 PM posted to microsoft.public.access.tablesdbdesign
John W. Vinson
external usenet poster
 
Posts: 18,261
Default Table update

On Mon, 25 Aug 2008 09:04:03 -0700, Jacques Steinman
wrote:

I have just realised that I have a problem with the way I set up my
master/detail form and table.

I used the following code in the "after update" of the column that items are
being selected from in the subform:

Private Sub d_itemid_AfterUpdate()

With Me.d_itemid
If Not IsNull(.Value) Then
Me.d_cost = .Column(3)
Me.d_eskpurch = .Column(5)
End If
End With

End Sub

Problem is, now when costs are updated in the product table it does not
automatically change on the already created entries in the detail table. It
only updates when the items are re-selected in the form.

I'm not very knowledgable wrt Access, so can anyone help me with this.
I don't want to change the tables as there are already thousands of entries
on the various tables in this database

Thanks in advance


Are you sure that you WANT to change them!? In a sales database you typically
will want to record the cost of the item *as of the time that it was
purchased*; if the cost later changes, you would not want to retroactively
change previous records.

What are the tables and fields involved? If you want the value to reflect the
current Item table, perhaps your d_cost and d_eskpurch fields should simply
not exist in the table; instead you can use a query to dynamically display
them.
--

John W. Vinson [MVP]
  #3  
Old August 25th, 2008, 06:30 PM posted to microsoft.public.access.tablesdbdesign
Jacques Steinman[_2_]
external usenet poster
 
Posts: 17
Default Table update

Yes, They have to be dynamic. I never took this into account when I started.
This is not an invoice generating form / system. The form creates a structure
record with the structure composing multiple items, and the record being used
whenever the structure is ordered.

The structure is then viewed, filtered and printed in another form. This is
where the correct cost counts. And this is where the cost is displayed as
seen in the table.

I know there is a fairly easy answer to this, I just don't what it is.



"John W. Vinson" wrote:

On Mon, 25 Aug 2008 09:04:03 -0700, Jacques Steinman
wrote:

I have just realised that I have a problem with the way I set up my
master/detail form and table.

I used the following code in the "after update" of the column that items are
being selected from in the subform:

Private Sub d_itemid_AfterUpdate()

With Me.d_itemid
If Not IsNull(.Value) Then
Me.d_cost = .Column(3)
Me.d_eskpurch = .Column(5)
End If
End With

End Sub

Problem is, now when costs are updated in the product table it does not
automatically change on the already created entries in the detail table. It
only updates when the items are re-selected in the form.

I'm not very knowledgable wrt Access, so can anyone help me with this.
I don't want to change the tables as there are already thousands of entries
on the various tables in this database

Thanks in advance


Are you sure that you WANT to change them!? In a sales database you typically
will want to record the cost of the item *as of the time that it was
purchased*; if the cost later changes, you would not want to retroactively
change previous records.

What are the tables and fields involved? If you want the value to reflect the
current Item table, perhaps your d_cost and d_eskpurch fields should simply
not exist in the table; instead you can use a query to dynamically display
them.
--

John W. Vinson [MVP]

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 05:02 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.