?
Solved

AfterUpdate Issue

Posted on 2011-02-16
9
Medium Priority
?
338 Views
Last Modified: 2013-11-05
I have a form which contains a combo box.  When the user selects a record from the combobox, an afterupdate event takes place to autopopulate 29 fields on the form.  But it seems to NOT populate fields if a field value is empty.  Or at least I think that is the problem.  Up to the point of the empty field all is ok, but after that point, not fields seem to populate.  Here is the code for the after update event.  Can someone tell me what I'm doing wrong?

    Me.txtCustomer_1 = Me.txtPart_No.Column(1)
    Me.txtPatterns_On = Me.txtPart_No.Column(2)
    Me.txtPattern_Type = Me.txtPart_No.Column(3)
    Me.txtFlask_Size = Me.txtPart_No.Column(4)
    Me.txtPatt_Loc = Me.txtPart_No.Column(5)
    Me.txtCBs = Me.txtPart_No.Column(8)
    Me.txtCPC = Me.txtPart_No.Column(9)
    Me.txtMetal = Me.txtPart_No.Column(10)
    Me.txtHeatTreat = Me.txtPart_No.Column(11)
    Me.txtPaint = Me.txtPart_No.Column(12)
    Me.txtWeight_Cstg = Me.txtPart_No.Column(13)
    Me.WghtEst = Me.txtPart_No.Column(14)
    Me.txtWeight_Mold = Me.txtPart_No.Column(15)
    Me.txtSI = Me.txtPart_No.Column(16)
    Me.txtRemarks = Me.txtPart_No.Column(17)
    Me.txtRemarks_2 = Me.txtPart_No.Column(18)
    Me.txtBrinell = Me.txtPart_No.Column(19)
    Me.txtCert = Me.txtPart_No.Column(20)
    Me.txtPriceRem = Me.txtPart_No.Column(21)
    Me.txtQualityRem = Me.txtPart_No.Column(22)
    Me.chkbxBlanketOrd = Me.txtPart_No.Column(23)
    Me.txtMachining = Me.txtPart_No.Column(24)
    Me.txtChillNcombined = Me.txtPart_No.Column(25)
    Me.txtRev = Me.txtPart_No.Column(26)
    Me.chkbxInclSC = Me.txtPart_No.Column(27)
    Me.chkbxSerialize = Me.txtPart_No.Column(28)
    Me.txtOPother = Me.txtPart_No.Column(29)
   
    Me.txtCores_Type = getLevels(Me.txtPart_No.Value)
    Me.txtCB_Loc = getLocations(Me.txtPart_No.Value)

--Steve
0
Comment
Question by:SteveL13
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
  • 3
9 Comments
 
LVL 44

Expert Comment

by:GRayL
ID: 34912470
why are you calling a combo box txtPart_no?
0
 

Author Comment

by:SteveL13
ID: 34912596
I had mis-named it way back when it was developed.  I should have named it cboPart_No.  But does the name matter?
0
 
LVL 44

Expert Comment

by:GRayL
ID: 34912915
No, but it sure throws troubleshooting for a loop.
0
Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

 
LVL 44

Expert Comment

by:GRayL
ID: 34912919
BTW, you are aware that the column index is 0 based? ie.  the first value of the column array is column(0)?
0
 

Author Comment

by:SteveL13
ID: 34924975
Yes.  But column (0) is actually the Part no which does not need to be populated to any field because that is the key being selected from the combobox.
0
 
LVL 3

Expert Comment

by:DockieBoy
ID: 34931861
What is the record source for the combo?
0
 

Author Comment

by:SteveL13
ID: 34932998
It is tblPartsMasters
0
 
LVL 3

Expert Comment

by:DockieBoy
ID: 34934458
Sorry, should have asked before if you can upload the db.
0
 
LVL 3

Accepted Solution

by:
DockieBoy earned 2000 total points
ID: 34934526
Also, something to consider, if the controls that are effected by the combo box are not to be edited by the user, you could try setting their control source to the appropriate column of the combo box.

eg:

Go to the properties sheet for the text box "txtCustomer_1" and in the control source, put the follolwing

=[txtPart_No].Column(1)

Alternatively, you could try using the "On Change" event for the combo box.  The After Update event is occurring when you exit the combo box to another control or when you save the record.  Their are other events in between that could be causing the problem, however, without seeing the db, this is just speculation.
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In earlier versions of Windows (XP and before), you could drag a database to the taskbar, where it would appear as a taskbar icon to open that database.  This article shows how to recreate this functionality in Windows 7 through 10.
This article describes two methods for creating a combo box that can be used to add new items to the row source -- one for simple lookup tables, and one for a more complex row source where the new item needs data for several fields.
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…
Suggested Courses

764 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question