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

Switch between sub and main forms

Hi again,

After puzzling all day I have (sort of) figured a round about way to
solve my problems.

I have a form callsmade with a subform allaccounts

On clicking on a record in the subform I wanted a field to be copied to
a bound textbox on my main form so I use this code;

Private Sub Form_Click()
[Forms]![CALLSMADE].Form!ACCOUNTID =
[Forms]![CALLSMADE]![ALLACCOUNTS].Form!ACCOUNTID
End Sub

This copies the information fine. However I then want the user to
select a value from a combo box on my main form and update a field in
my subform with this information so I use this;

Private Sub Combo60_AfterUpdate()
Form.Refresh
[Forms]![CALLSMADE]![ALLACCOUNTS].Form!CALLAGEFREQUENCY = Me.Combo60
[Forms]![CALLSMADE]![ALLACCOUNTS].Form.Refresh
End Sub

The problem I have is that after the first pice of code (sub
form_click) the focus seems to be on the subform and it won't let me
select my combobox in my main form.
In Excel (sorry I know it's totally different) I would code like below

eg
[Forms]![CALLSMADE].Form.activate

to refocus on the main form (and I hope doing this would solve my
problem of not being able to select my combo on the main form).

Does it seem like I have identified the problem correctly, and if so
how can I code to re-focus on my main form?

Jan 26 '07 #1
1 2222
Apologies for the duplicate.

I have discovered that I can't select anything from my combo box (after
the first onclick code has worked) until a lot of doublt clicking
highlights it. If I make a selection in the combo it only updates the
table if the selected record has a little pencil icon thing in the
margin next to it.

I presume this is some sort of edit mode - can I put this in my code?
On 26 Jan, 17:51, "keri" <keridow...@hotmail.comwrote:
Hi again,

After puzzling all day I have (sort of) figured a round about way to
solve my problems.

I have a form callsmade with a subform allaccounts

On clicking on a record in the subform I wanted a field to be copied to
a bound textbox on my main form so I use this code;

Private Sub Form_Click()
[Forms]![CALLSMADE].Form!ACCOUNTID =
[Forms]![CALLSMADE]![ALLACCOUNTS].Form!ACCOUNTID
End Sub

This copies the information fine. However I then want the user to
select a value from a combo box on my main form and update a field in
my subform with this information so I use this;

Private Sub Combo60_AfterUpdate()
Form.Refresh
[Forms]![CALLSMADE]![ALLACCOUNTS].Form!CALLAGEFREQUENCY = Me.Combo60
[Forms]![CALLSMADE]![ALLACCOUNTS].Form.Refresh
End Sub

The problem I have is that after the first pice of code (sub
form_click) the focus seems to be on the subform and it won't let me
select my combobox in my main form.
In Excel (sorry I know it's totally different) I would code like below

eg
[Forms]![CALLSMADE].Form.activate

to refocus on the main form (and I hope doing this would solve my
problem of not being able to select my combo on the main form).

Does it seem like I have identified the problem correctly, and if so
how can I code to re-focus on my main form?
Jan 26 '07 #2

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

Similar topics

1
by: wayneh | last post by:
I have an option group on a form with three choices "Yes/No/All" I'm using a switch function in a query to filter records on a Yes/No field. There is no problem displaying records that are either...
13
by: webzila | last post by:
Hello, I have to write a program for an 8051 micro-controller using micro-C to monitor Switch 1 and if the switch in pushed the message "switch 1 pushed" should be displayed in the LCD. Also the...
1
by: BillZondlo | last post by:
Can someone look at this and tell me why, when I call this from my main app, it displays fine (fades form in and out) but then before my main app displays, I see other dialog boxes flash...
5
by: Yavuz Bogazci | last post by:
Hi, i have the following problem: In VB6 i switched between two forms on this way: FORM1: sub onButton_Click form2.show me.close
9
by: Tim | last post by:
Hi, I hope this is an easy question for you guys... I have an application that I need to be able to switch from sqlserver to access at runtime. I can change from one sqlserver installation to...
9
by: PhreakRox | last post by:
The ToClose switch in this program is not working as expected, it allways returns a null value, if anyone knows a way to fix up the code, or can suggest a better method of doing so, your help would...
5
by: Martin | last post by:
Morning, I am developing a C# 2.0 application and I have created two language (English and French) for my main form. In Visual Studio 2005, I can switch language with the Language property...
0
by: keri | last post by:
Hi again, After puzzling all day I have (sort of) figured a round about way to solve my problems. I have a form callsmade with a subform allaccounts On clicking on a record in the subform I...
9
by: Cybex | last post by:
I am trying to get this to work but when ever I enter an proper integer it just hangs. The Switch default seems to catch the improper integers but the right ones are not triggering the way I...
4
by: kpfunf | last post by:
I have a field whose criteria I can't quite work out. I have an Option Group on a form. If the value is 2, 3 or 4, then criteria equals as shown below (works fine). The kicker is value 1: I want...
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...
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
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
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.