hi (Ken?)
adding onto Duane's comment ...
if ItemCode is stored as a number, not text
then Case "253010417"
would be Case 253010417
since numbers are not delimited and text is delimited with quote marks.
Regarding the values you are transferring ...
better than duplicating information about an item would be simply to store its primary key so you can join in related information about the item anytime! Here is a short book you can read on designing databases with Access:
Access Basics
http://www.AccessMVP.com/strive4peace
have an awesome day,
crystal
What is not working? Have you stepped through the code or included any debug.print?
Is there are reason for two separate Select Case rather just one?
Private Sub ItemCode_AfterUpdate()
��� Select Case Me.ItemCode
��� ����Case "253010417"
��� ��������Me.Item = "Plastic Bag"
��� ��������Me.ItemType = "Sandwich"
��� ��������Me.ItemBrand = "Up&Up"
��� ��������Me.PackUp = "Bag"
��� ����Case "288072410"
��� ��������Me.Item = "Dairy"
��� ��������Me.ItemType = "Ice Cream"
��� ��������Me.ItemBrand = "Market Pantry"
��� ��������Me.PackUp = "Can"
��� End Select
End Sub
Duane Hookom
From: MS_Access_Professionals@yahoogroups.com <MS_Access_Professionals@yahoogroups.com> on behalf of kenaf42@yahoo.com [MS_Access_Professionals] <MS_Access_Professionals@yahoogroups.com>
Sent: Tuesday, November 13, 2018 1:44 PM
To: MS_Access_Professionals@yahoogroups.com
Subject: [MS_AccessPros] Please help, VBA code�
Access 2010, Windows 7.
What is wrong? It is not working. ItemCode is TEXT in underlying table although entered data are numbers.
�
Private Sub ItemCode_AfterUpdate()
Select Case Me.ItemCode
Case "253010417"
Me.Item = "Plastic Bag"
Me.ItemType = "Sandwich"
Me.ItemBrand = "Up&Up"
Me.PackUp = "Bag"
End Select
�
Select Case Me.ItemCode
Case "288072410"
Me.Item = "Dairy"
Me.ItemType = "Ice Cream"
Me.ItemBrand = "Market Pantry"
Me.PackUp = "Can"
End Select
�
End Sub
Posted by: crystal 8 <strive4peace2008@yahoo.com>
Reply via web post | • | Reply to sender | • | Reply to group | • | Start a New Topic | • | Messages in this topic (3) |
Tidak ada komentar:
Posting Komentar