Data disappearing from unbound text boxes upon edit.

yeahyeahyeah

Registered User.
Local time
Today, 03:35
Joined
Jan 12, 2006
Messages
13
Hello,

I have a form that utilizes a combo box called cboProgAddr (for Program Address). The cbox has 5 columns each of which fills in an adjacent text box. Since I needed the option of making corrections to these text boxes once they were filled in I need to set them up as unbound via the following code in the After Update event of cboProgAddr:

Private Sub cboProgAddr_AfterUpdate()
Me!txtProgStreet.Value = Me!cboProgAddr.Column(1)
Me!txtLocStreet.Value = Me!cboProgAddr.Column(1)
Me!txtProgCitySt.Value = Me!cboProgAddr.Column(2)
Me!txtLocCitySt.Value = Me!cboProgAddr.Column(2)
Me!txtProgZip.Value = Me!cboProgAddr.Column(3)
Me!txtLocZip.Value = Me!cboProgAddr.Column(3)
End Sub

As you can see it puts each field of data into two separate text boxes. Here's the issue: If I have to go back to the form after the original data entry the following boxes are blank...

txtProgStreet
txtProgCitySt
txtProgZip

while the following retain the orginal data...

txtLocStreet
txtLocCitySt
txtLocProgZip

The original cboProgAddr maintains its original data. All six fields above are stored in the same table as text field. I'd like all the boxes to maintain the data from the original input.

I'm totally baffled why this is so. I've attached images of the combo box control functions if that helps.


Thanks,
David
 

Attachments

  • othercontrol.GIF
    othercontrol.GIF
    16.9 KB · Views: 204
  • formatcontrol.GIF
    formatcontrol.GIF
    19.7 KB · Views: 202
  • datacontrol.GIF
    datacontrol.GIF
    18.6 KB · Views: 173
...I need to set them up as unbound via the following code...
The code you posted does *not* "set them up as unbound" as you suggest. I suspect that the txtLoc... controls have a ControlSource (bound to a field) while the txtProg... controls do not (unbound). As far as I can see there is no reason why any of these controls should be unbound.
 

Users who are viewing this thread

Back
Top Bottom