473,434 Members | 1,791 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,434 software developers and data experts.

Yet more confusion...

Hello again..

I have a form (contacts), with a subform (calls). Tables are in a one
to many relationship, and work fine in queries, etc.. I can't get my
form to work the way I want though

Main form (Contacts) has last name, first name, phone, etc... Subform
(Calls) has date/time of call as well as results. On the main form I
have an unbound combo box that I have populated with the contacts last
names (it reads them from the contacts tbl). I want to be able to use
that combobox to select a contacts last name and have the form/subform
refresh/update to the record for the name within the combobox. If I
select a different name, the form should go to that name, etc...

I've tried several things, and here are my results. Anybody know what
I am doing wrong (besides everything!)?

- Right now, I select a name in the combo and have to tab out to
refresh the forms. Would like to get away from the tab requirement at
this point.
- However, my test d/b has four names in it, but the refresh only
seems to bounce back and forth between two names, regardless of which
name I select.

Refresh, requery, repaint.... nothing seems to be working correctly,
and I'm sure that I'm doing something stupid to make this happen like
this. I've tried a requery macro "onchange" and that didn't work.
Neither did putting it in code, using OnUpdate, etc... I've started at
the screen for at least 3 hours today. I've made other d/b's do this
and comparing the two, I simply can't see any difference.. Help!

Jan 26 '07 #1
3 1324

Would it be better to just have some sort of "find record" or "go to
record" function that searches for the record with the name in the
unbound combo box?

If so, could I get this to automatically run "onChange" or
"AfterUpdate"?

What would be the code for this? This seems like an easier way to make
it happen, but not sure...

Jan 26 '07 #2
sb****@cbpacific.com wrote:
Hello again..

I have a form (contacts), with a subform (calls). Tables are in a one
to many relationship, and work fine in queries, etc.. I can't get my
form to work the way I want though

Main form (Contacts) has last name, first name, phone, etc... Subform
(Calls) has date/time of call as well as results. On the main form I
have an unbound combo box that I have populated with the contacts last
names (it reads them from the contacts tbl). I want to be able to use
that combobox to select a contacts last name and have the form/subform
refresh/update to the record for the name within the combobox. If I
select a different name, the form should go to that name, etc...

I've tried several things, and here are my results. Anybody know what
I am doing wrong (besides everything!)?

- Right now, I select a name in the combo and have to tab out to
refresh the forms. Would like to get away from the tab requirement at
this point.
- However, my test d/b has four names in it, but the refresh only
seems to bounce back and forth between two names, regardless of which
name I select.

Refresh, requery, repaint.... nothing seems to be working correctly,
and I'm sure that I'm doing something stupid to make this happen like
this. I've tried a requery macro "onchange" and that didn't work.
Neither did putting it in code, using OnUpdate, etc... I've started at
the screen for at least 3 hours today. I've made other d/b's do this
and comparing the two, I simply can't see any difference.. Help!

Given that the main form is frmMain and the subform name is
frmMainSubCalls with the subform *control* on frmMain called subCalls.
The combo is called cboContact. Presumeably you have the recordsource
of frmMainSubCalls (ie, the subform control subCalls) set up so as to be
dependent on the value of the combo box.

Sub subCalls_AfterUpdate()

me.subCalls.Form.Requery

End Sub

Note - on a design note, you may well have this done, but you should
consider using an autonumber for each caller and use that as the foreign
key.
--
Tim http://www.ucs.mun.ca/~tmarshal/
^o<
/#) "Burp-beep, burp-beep, burp-beep?" - Quaker Jake
/^^ "Whatcha doin?" - Ditto "TIM-MAY!!" - Me
Jan 26 '07 #3

Thanks, I'll give it a try. Question - it appears that this function
requerys the subform, but not the mainform. I'm not having problems
with the subform/child, only with the main/parent. Table relationship
(1 to many) works well and if I manually go to a record in the
main/parent, the subform follows along greatly because they are indeed
to together with a foreign key as you mention.

However, if I use the unbound combo box to state which contact I
would like to go it, none of it works. I need the mainform record to
update to whichever name I have selected in the combo box.

There is a BOUND combo box on the main form called "Full"
There is an UNBOUND combo box on the subform called "cboContact"

When I select "john jones" in cboContact, I want the mainform to search
the d/b, find the correct contact, and refresh the main/sub form to
display that info. When I select another name, I need it to do it all
over again for the new name. Would it be better to just try and figure
out a "go to record" routine of some sort instead of trying to
refresh/requery the screen? I know squat about VBA, so any help with
this code would be greatly appreciated.

Jan 26 '07 #4

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

Similar topics

1
by: Doug Farrell | last post by:
Hi all, I'm trying to do the following from within a code module: import re # text to match text = "Good morning x something /x, how are you today x something else /x"
1
by: Mathias Mamsch | last post by:
Hi, I have some confusion concerning the weakref module. I am trying to save a weak reference to a bound member function of a class instance for using it as a callback function. But I always...
38
by: Grant Edwards | last post by:
In an interview at http://acmqueue.com/modules.php?name=Content&pa=showpage&pid=273 Alan Kay said something I really liked, and I think it applies equally well to Python as well as the languages...
10
by: Kamilche | last post by:
I'm trying to pack two characters into a single byte, and the shifting in Python has me confused. Essentially, it should be possible to use a 'packed string' format in Python, where as long as...
4
by: JMCN | last post by:
object invalid or no longer set - confusion of the recordset in access 2003. i am currently converting from access 97 to access 2003. majority of the codes converted over perfectly fine, though...
0
by: i_have_control | last post by:
I'd be grateful for any input on this one: I have three web domains. The destinations of two are set to folders on the first, though that fact is transparent to the user (i.e: it does not...
13
by: Steve | last post by:
I have a form with a dataset and a datagrid. I created a dataview on this dataset. When the user modifies the datagrid, I look up this record in the dataview to make sure it is unique. Here is...
10
by: joelagnel | last post by:
hi friends, i've been having this confusion for about a year, i want to know the exact difference between text and binary files. using the fwrite function in c, i wrote 2 bytes of integers in...
1
by: Richard Lewis Haggard | last post by:
I'm having a problem with what appears to be some sort of confusion with references. I have a single solution with a dozen projects which has been working quite nicely for a while. The references...
2
by: Riaaaa | last post by:
Hello, We are doing the project in VB.Net. We had a great confusion for ASP.Net and VB.Net. Is VB.Net project performed in Microsoft Visual Studio 2005 ?? We have...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
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...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
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...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...

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.