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

Me.cboProjService.Column(3) Not working correctly

31
I have a combobox on a subform with this code attached.

Expand|Select|Wrap|Line Numbers
  1. Private Sub cboProjService_Change()
  2. If Not IsNull(Me.cboProjService) Then
  3.     Me.SortOrder.Value = Me.cboProjService.Column(3)
  4.     Me.Refresh
  5.     Me.Requery
  6. End If
  7. End Sub
The subform is a continuous form. The Combobox updates the SortOrder field of the first record but subsequent records do not update when changed.

What am I doing wrong?
Feb 16 '09 #1
6 1750
NeoPa
32,556 Expert Mod 16PB
Nothing. As far as I can see. You are updating the current (selected) record.

This depends of course, on what you are trying to do. If this is not it then the code is wrong. What are your intentions?

PS. Line #4 is entirely redundant. Line #5 is a superset.
Feb 16 '09 #2
topher23
234 Expert 100+
As NeoPa pointed out, this code should update the current record. You said that the combo box will update the first record in the set, but not subsequent records. Did you mean that the combo box updates the first record every time the value is changed, no matter which record is selected, or that it only works when the first record is selected?
Feb 16 '09 #3
OzNet
31
Thanks for your replies, I'll try and give you the essential information.

The combobox is bound (control source) to the ProjectServiceLS field of the tblProjectEsitmates table via a query. This table and query also has a field called SortOrder which I want automatically filled when making a selection in the combobox.

The combobox looks up a table called tblProjectServices to get the PCode (Project Code) field value. The tblProjectServices table also has a filed called SortOrder which allocates the logical sequence of the Project Services listed. I want this value (column 3 in the combobox) to go into the SortOrder field of the tblProjectEstimates table so I can sort the list by this field.

When I change the selection in the combobox of the first record, the Project code changes and the correct sortorder appears in my field.

When I change any of the records below the first, the Project code changes but nothing else does. The first record sortorder remains the same and the sortorder field of the edited record remains blank!

Could Access get confused with the two tables having the same SortOrder field name? I will give this a try.
Feb 16 '09 #4
NeoPa
32,556 Expert Mod 16PB
Check that the control on your form is actually bound. It sounds as if maybe it's not.
Feb 16 '09 #5
OzNet
31
OK - I worked out what was wrong.

I created another combobox which worked and then compared the different properties.

The problem was a piece of code which I had attached to the OnClick property:
Expand|Select|Wrap|Line Numbers
  1. Me.Requery
and must have interfered with the action of the OnChange piece of code.

I would have added this code to refresh the data and then later added the OnChange code.
Feb 17 '09 #6
NeoPa
32,556 Expert Mod 16PB
The solution :)

Thanks for posting it. We always appreciate that where possible.
Feb 17 '09 #7

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Holmespundit | last post by:
Stylists... I'm having problems collapsing a column. Specifically, I want to collapse the last column of a table. My initial test with a large data set worked, but I cannot make it work with a...
10
by: Ed | last post by:
The page I'm working on is at http://www.coldpizzasoftware.com/temp/layout.html I trying to get the yellow sidebar to go in the white area to the right of the green content area and between the...
2
by: Ed via AccessMonster.com | last post by:
Hi all, What I am trying to do is get the value of the second column of a bound combo box in vba. example: Combo box: column 1-ID column 2-SIGN_CODE 1 R-1.gif 2 ...
10
by: Robert Schuldenfrei | last post by:
Hi NG: I have the following code working. The GetProdStrtList() returns a DataTable called psTable. A Grid control is successfully bound to this table and displays correctly. I would like to...
6
by: Robert Schuldenfrei | last post by:
Dear NG, After being away from C# programming for a spell, I am trying my hand at what should be a simple task. I have been hitting my head against the wall this morning. I have a simple order...
1
by: Drew | last post by:
Hey, thanks in advance for helping me out with my problem: I have a datagrid which is embedded in another datagrid. The datagrid is filled directly by a dataset generated from a sql query. So...
9
by: Kevin Westhead | last post by:
Can anyone confirm whether or not there are any limits imposed on the widths of autosized columns in a list-view. I've found that the autosizing appears to have an upper limit, i.e. it will not...
4
by: SEliel | last post by:
Hello everyone: I'm programming a custom GridView, adding column by column dynamically. Every column is a TemplateField, and I've made a class hierarchy for each template (TextColumnTemplate,...
7
by: jfkjfk | last post by:
Hello, I am trying to make a page with a design as follows: page is centered horizontaly with a total width of 1000 - a Header on top - a Footer at the bottom - in between the header and the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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
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
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...

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.