473,396 Members | 2,033 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Combobox value not saved - why

Greetings.

I have a form (frmDogs) that is invisible while a subsequent form
(frmPeople) is visible. The visible form sets a value for a combobox
(cboOwner) in the hidden form, makes the invisible form visible and then
closes. When the newly visible form (frmDogs) appears the combo box
(cboOwner) is displaying the correct information (set from the previous
form). There is no indication that anything is wrong when I save the
Dog record.

If I close frmDogs and then return to the recently saved record, the
combobox cboOwner is blank, meaning the record was not saved with the
data that was assigned to it prior to the save.

Some more info ...
cboOwner is bound to [peopleID] with the RowSource = SELECT
tblPeople.peopleID, tblPeople.lname & ", " & tblPeople.fname & ("
"+tblPeople.midinit+".") & (" "+tblPeople.suffix+".") & " (" &
tblPeople.city & ", " & tblPeople.state & ")" AS ownerinfo
FROM tblPeople
ORDER BY tblPeople.lname;

if frmPeople the logic to set the cboOwner field in the invisible field
is ...

'Is the frmDogs form open?
blnDogs_Open = SysCmd(acSysCmdGetObjectState, acForm, "frmDogs") And
acObjStateOpen

If blnDogs_Open Then
If lngNewPID > 0 Then
Forms("frmDogs").Visible = True
If blnNewOwner = True Then
Forms("frmDogs")!cboOwner.Requery
Forms("frmDogs")!cboOwner = lngNewPID
blnNewOwner = False
End If
End If
End If

Any ideas?

Regards,
SueB

*** Sent via Developersdex http://www.developersdex.com ***
Nov 13 '05 #1
2 1912
On Mon, 07 Nov 2005 12:17:11 GMT, Susan Bricker <sl*****@verizon.net> wrote:
Greetings.

I have a form (frmDogs) that is invisible while a subsequent form
(frmPeople) is visible. The visible form sets a value for a combobox
(cboOwner) in the hidden form, makes the invisible form visible and then
closes. When the newly visible form (frmDogs) appears the combo box
(cboOwner) is displaying the correct information (set from the previous
form). There is no indication that anything is wrong when I save the
Dog record.

If I close frmDogs and then return to the recently saved record, the
combobox cboOwner is blank, meaning the record was not saved with the
data that was assigned to it prior to the save.

Some more info ...
cboOwner is bound to [peopleID] with the RowSource = SELECT
tblPeople.peopleID, tblPeople.lname & ", " & tblPeople.fname & ("
"+tblPeople.midinit+".") & (" "+tblPeople.suffix+".") & " (" &
tblPeople.city & ", " & tblPeople.state & ")" AS ownerinfo
FROM tblPeople
ORDER BY tblPeople.lname;
If I understand your thinking here, this might b your problem. Assigning a
Row Source is not binding a control to a field. Assigning a row source tells
where the list of selections comes from, but assigning the Control Source
binds the control to a field. It's very much possible for a combo or list box
to have a Row Source, and be unbound.
if frmPeople the logic to set the cboOwner field in the invisible field
is ...

'Is the frmDogs form open?
blnDogs_Open = SysCmd(acSysCmdGetObjectState, acForm, "frmDogs") And
acObjStateOpen

If blnDogs_Open Then
If lngNewPID > 0 Then
Forms("frmDogs").Visible = True
If blnNewOwner = True Then
Forms("frmDogs")!cboOwner.Requery
Forms("frmDogs")!cboOwner = lngNewPID
blnNewOwner = False
End If
End If
End If

Any ideas?

Regards,
SueB

*** Sent via Developersdex http://www.developersdex.com ***


Nov 13 '05 #2
Steve,

Thanks for the explanation. I understand. I'll have to make sure to
save the [peopleID] field that is the primary key to the People record
and the foreign key that is saved in the Dog record (Owner field). So,
I'll save the [peopleID] as well of synchronizing the combobox
[cboOwner].

Regards,
SueB

*** Sent via Developersdex http://www.developersdex.com ***
Nov 13 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: amber | last post by:
Hello, I'm using the following code to work with a combobox: combobox1.Datasource = employeeDataset.Table(0) combobox1.ValueMember = "STR_INITIALS" combobox1.DisplayMember = "BOTH_NAMES"...
2
by: Tark Siala | last post by:
hi in VB6 (Listbox and Combobox) have nice Properties called (Item Data) when i go to VB.NET i can't Find this Properties :( please help me , i want Save tow value in one item in ComboBox 1 -...
0
by: Gamze | last post by:
Hi, In my vb.net windows application ,i have combobox which is populated by sqlserver database table.When i select value from combobox ,value saved in to other table of my database and i use to...
4
by: Michael Turner | last post by:
Hi I am having a problem with a combobox the values are generated from a recordset, I need to beable to change the selected item to the value specified in a configuration file, I have stored the...
0
by: dbuchanan | last post by:
ComboBox databindng Problem == How the ComboBox is setup and used: My comboBox is populated by a lookup table. The ValueMember is the lookup table's Id and the DisplayMember is the text from a...
4
by: jon f kaminsky | last post by:
Hi- I've seen this problem discussed a jillion times but I cannot seem to implement any advice that makes it work. I am porting a large project from VB6 to .NET. The issue is using the combo box...
6
by: dbuchanan | last post by:
VS2005 I've been reading all the help I can on the topic (MSDN, other) but I can't make sense of this. Desired behavior; The user is to choose from the displayed list of the databound combobox...
1
by: tizmagik | last post by:
I have a combobox on a continuous form that has a recordsource that is set upon Form_Load event via VBA (based on initial form data and external form data entered). For data entry purposes the...
2
by: =?Utf-8?B?SmFtZXMgTWFydGlu?= | last post by:
I have a table that I dragged onto a form from a dataset. I changed some of the fields to comboboxes and set the data source, display member (text), and value member (int) to another table within...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.