473,769 Members | 4,089 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

5 Tabs, 1 Combo and something quite strange.

Hi All,

I have a form with a standard combo box and 5 tabs in A2003.

On Form Open, I set Me.Detail.Visib le = False and in the after update
event of the combo set Me.Detail.Visib le = True,( to open form with no
info showing ) I've noticed something quite strange.

I open the form ( details are not visible ) select any record ID with
the combo and the details come up OK. I click anywhere on the
tabcontrol and it immediately goes back to the first record ( ID 1 ).I
select a different ID with the combo and all is well.

Now, if I start again and open the form, select any ID from the combo
and let those details come up then immediately select a different ID
from the combo box, I can now click on the tab control and all is
well.

If I leave the form detail as the default ie Visible, no problems.

Any ideas as to why the clicking the tab control under these
circumstances whould throw back to the first record in the
recordsource table?
Is there a more efficient and elegant way of opening a form as blank,
and only showing the records once the user has selected a record ID?

Regards

Karl
Nov 13 '05 #1
3 1467
Hi Karl

Some ways to open a form so it is blank:

a) Filter to a condition that is False for all records:
Private Sub Form_Open(Cance l As Integer)
Me.Filter = "(False)"
Me.FilterOn = True
End Sub

b) Go straight to a new record:
Private Sub Form_Load()
If Not Me.NewRecord Then
RunCommand acCmdRecordsGot oNew
End If
End Sub

c) Change the RecordSource of the form.
Save the form as:
SELECT * FROM MyTable WHERE (False);
In the AfterUpdate of your combo:
Private Sub Me.cbo1_AfterUp date()
Dim strSql As String
If IsNull(Me.cbo1) Then
strSql = "SELECT * FROM MyTable WHERE (False);"
Else
strSql = "SELECT * FROM MyTable WHERE MyField = " & Me.cbo1 &
";"
End If
Me.RecordSource = strSql
End Sub

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"Karl Roes" <ka******@hotma il.com> wrote in message
news:7c******** *************** ***@posting.goo gle.com...
Hi All,

I have a form with a standard combo box and 5 tabs in A2003.

On Form Open, I set Me.Detail.Visib le = False and in the after update
event of the combo set Me.Detail.Visib le = True,( to open form with no
info showing ) I've noticed something quite strange.

I open the form ( details are not visible ) select any record ID with
the combo and the details come up OK. I click anywhere on the
tabcontrol and it immediately goes back to the first record ( ID 1 ).I
select a different ID with the combo and all is well.

Now, if I start again and open the form, select any ID from the combo
and let those details come up then immediately select a different ID
from the combo box, I can now click on the tab control and all is
well.

If I leave the form detail as the default ie Visible, no problems.

Any ideas as to why the clicking the tab control under these
circumstances whould throw back to the first record in the
recordsource table?
Is there a more efficient and elegant way of opening a form as blank,
and only showing the records once the user has selected a record ID?

Regards

Karl

Nov 13 '05 #2
Hi Allen,

Changing the forms RecordSource looks a winner. Will reply with the outcome.

Thanks Allen

Karl.

"Allen Browne" <Al*********@Se eSig.Invalid> wrote in message news:<41******* *************** @per-qv1-newsreader-01.iinet.net.au >...
Hi Karl

Some ways to open a form so it is blank:

a) Filter to a condition that is False for all records:
Private Sub Form_Open(Cance l As Integer)
Me.Filter = "(False)"
Me.FilterOn = True
End Sub

b) Go straight to a new record:
Private Sub Form_Load()
If Not Me.NewRecord Then
RunCommand acCmdRecordsGot oNew
End If
End Sub

c) Change the RecordSource of the form.
Save the form as:
SELECT * FROM MyTable WHERE (False);
In the AfterUpdate of your combo:
Private Sub Me.cbo1_AfterUp date()
Dim strSql As String
If IsNull(Me.cbo1) Then
strSql = "SELECT * FROM MyTable WHERE (False);"
Else
strSql = "SELECT * FROM MyTable WHERE MyField = " & Me.cbo1 &
";"
End If
Me.RecordSource = strSql
End Sub

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"Karl Roes" <ka******@hotma il.com> wrote in message
news:7c******** *************** ***@posting.goo gle.com...
Hi All,

I have a form with a standard combo box and 5 tabs in A2003.

On Form Open, I set Me.Detail.Visib le = False and in the after update
event of the combo set Me.Detail.Visib le = True,( to open form with no
info showing ) I've noticed something quite strange.

I open the form ( details are not visible ) select any record ID with
the combo and the details come up OK. I click anywhere on the
tabcontrol and it immediately goes back to the first record ( ID 1 ).I
select a different ID with the combo and all is well.

Now, if I start again and open the form, select any ID from the combo
and let those details come up then immediately select a different ID
from the combo box, I can now click on the tab control and all is
well.

If I leave the form detail as the default ie Visible, no problems.

Any ideas as to why the clicking the tab control under these
circumstances whould throw back to the first record in the
recordsource table?
Is there a more efficient and elegant way of opening a form as blank,
and only showing the records once the user has selected a record ID?

Regards

Karl

Nov 13 '05 #3
Hi,

Success!!

Thanks Allen

Karl.

ka******@hotmai l.com (Karl Roes) wrote in message news:<7c******* *************** ****@posting.go ogle.com>...
Hi Allen,

Changing the forms RecordSource looks a winner. Will reply with the outcome.

Thanks Allen

Karl.

"Allen Browne" <Al*********@Se eSig.Invalid> wrote in message news:<41******* *************** @per-qv1-newsreader-01.iinet.net.au >...
Hi Karl

Some ways to open a form so it is blank:

a) Filter to a condition that is False for all records:
Private Sub Form_Open(Cance l As Integer)
Me.Filter = "(False)"
Me.FilterOn = True
End Sub

b) Go straight to a new record:
Private Sub Form_Load()
If Not Me.NewRecord Then
RunCommand acCmdRecordsGot oNew
End If
End Sub

c) Change the RecordSource of the form.
Save the form as:
SELECT * FROM MyTable WHERE (False);
In the AfterUpdate of your combo:
Private Sub Me.cbo1_AfterUp date()
Dim strSql As String
If IsNull(Me.cbo1) Then
strSql = "SELECT * FROM MyTable WHERE (False);"
Else
strSql = "SELECT * FROM MyTable WHERE MyField = " & Me.cbo1 &
";"
End If
Me.RecordSource = strSql
End Sub

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"Karl Roes" <ka******@hotma il.com> wrote in message
news:7c******** *************** ***@posting.goo gle.com...
Hi All,

I have a form with a standard combo box and 5 tabs in A2003.

On Form Open, I set Me.Detail.Visib le = False and in the after update
event of the combo set Me.Detail.Visib le = True,( to open form with no
info showing ) I've noticed something quite strange.

I open the form ( details are not visible ) select any record ID with
the combo and the details come up OK. I click anywhere on the
tabcontrol and it immediately goes back to the first record ( ID 1 ).I
select a different ID with the combo and all is well.

Now, if I start again and open the form, select any ID from the combo
and let those details come up then immediately select a different ID
from the combo box, I can now click on the tab control and all is
well.

If I leave the form detail as the default ie Visible, no problems.

Any ideas as to why the clicking the tab control under these
circumstances whould throw back to the first record in the
recordsource table?
Is there a more efficient and elegant way of opening a form as blank,
and only showing the records once the user has selected a record ID?

Regards

Karl

Nov 13 '05 #4

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

Similar topics

2
2181
by: Jeff Mason | last post by:
I'm observing some strange behavior when I use a bound combo box in conjunction with the combo's anchor property. I define a form which contains just a textbox and a combo box. The text box is placed before the combo in taborder, and is there only so the focus will go someplace other than the combo box when the form is displayed. In the form load event, I have the following code to create an arraylist and bind the combo to it: Dim a As...
7
12275
by: sara | last post by:
I have a form where the user selects an item from a list box, and then works on that item. The user chooses an AD, then opens a form to assign departments to the ad. The top of the Depts form has a combo box, to select an ad from the drop down list. I would like the Depts form to open with the Ad selected on the Main form displaying in the combo box, AND any information already added presented to the user. (I am thinking this latter...
135
7518
by: Xah Lee | last post by:
Tabs versus Spaces in Source Code Xah Lee, 2006-05-13 In coding a computer program, there's often the choices of tabs or spaces for code indentation. There is a large amount of confusion about which is better. It has become what's known as “religious war” — a heated fight over trivia. In this essay, i like to explain what is the situation behind it, and which is proper.
0
2928
by: Jeremy Wallace | last post by:
Folks, Here's a write-up I did for our developer wiki. I don't know if the whole rest of the world has already figured out how to do this, but I hadn't ever seen it implemented, and had spent a lot of time trying to figure it out, over the years. It finally dawned on me a couple of weeks ago how to do this. A couple of notes: 1) This is written for a different audience than CDMA; it's written for
10
3666
by: Tom | last post by:
I'd like to create a new VB 2005 app that looks like the VS 2005 IDE - in other words, an app that has multiple forms, but instead of displaying them seperately or in an MDI main from, I'd rather display them in tabs across the screen. I might have functions that are available to the app in the tree view on the left, then as they select functions it would open them in a new tab... again, almost exactly as the VB IDE does. My question...
35
2721
by: Ben | last post by:
Hi, I have a python script on a unix system that runs fine. I have a python script on a windows system that runs fine. Both use tabs to indent sections of the code. I now want to run them on the same system, actually in the same script by combining bits and pieces. But whatever I try my windows tabs get converted to spaces when I transfer it to the unix system and the interpreter complains that the indentation style is not consistent...
7
1612
by: raneking22 | last post by:
I have a form with 2 combo boxes in it. The first combo box is named combo0 and has as its row source: SELECT DISTINCT !field1 FROM ORDER BY ; The second combo box has as its row source: SELECT DISTINCT !field2AS Expr1 FROM WHERE (((.field1)=Forms!form1!combo0)); So basically, the user selects from the first combo box which field1 value they want to limit their returned recordset to. Then the second combo box populates with all...
2
7049
by: biganthony via AccessMonster.com | last post by:
Hi, I decided to install Office 2003 Service Pack 3 on my home computer to test (in full knowledge that there may be some issues with it). After installation, I have noticed that with a small database I wrote for home, the combo boxes and listboxes no longer display the bound column. For example, on a form I have a combo box based on a table called 'names'. The two columns in the combo box are ID and Surname. The combo box and list box...
7
3582
by: Brad Pears | last post by:
I have something strange going on - pretty sure it used to work before - and now it does not... Why does the following code not clear a combo box? Me.cboLocation.Text = String.Empty OR Me.cboLocation.Text = ""
0
9422
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10208
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10038
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9987
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9857
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7404
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 presenter, Adolph Dupr who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5294
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5444
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3558
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.