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

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.Visible = False and in the after update
event of the combo set Me.Detail.Visible = 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 1437
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(Cancel 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 acCmdRecordsGotoNew
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_AfterUpdate()
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******@hotmail.com> wrote in message
news:7c**************************@posting.google.c om...
Hi All,

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

On Form Open, I set Me.Detail.Visible = False and in the after update
event of the combo set Me.Detail.Visible = 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*********@SeeSig.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(Cancel 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 acCmdRecordsGotoNew
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_AfterUpdate()
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******@hotmail.com> wrote in message
news:7c**************************@posting.google.c om...
Hi All,

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

On Form Open, I set Me.Detail.Visible = False and in the after update
event of the combo set Me.Detail.Visible = 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******@hotmail.com (Karl Roes) wrote in message news:<7c**************************@posting.google. com>...
Hi Allen,

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

Thanks Allen

Karl.

"Allen Browne" <Al*********@SeeSig.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(Cancel 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 acCmdRecordsGotoNew
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_AfterUpdate()
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******@hotmail.com> wrote in message
news:7c**************************@posting.google.c om...
Hi All,

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

On Form Open, I set Me.Detail.Visible = False and in the after update
event of the combo set Me.Detail.Visible = 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
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...
7
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...
135
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...
0
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...
10
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...
35
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...
7
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: ...
2
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...
7
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 ...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.