473,405 Members | 2,415 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,405 software developers and data experts.

two questions. 1) rowsource 2) refresh combo box list after add a record

12
here's my problem

1) rowsource

.RowSource = "select distinct [projectID],[projectDescription] " & "from Projects " & " where [projectID]=" & Me![projectID]

I have the above code, and it works fine. however, i want to make the combo box in alphabetical order by [projectDescription]. I tried to add "order by [project Description] " after "me![projectID]". But it gives me error msg. Can someone tell me how can i do that. Thanks.

2) REfresh the combo box list after add a record.

i have a tab in the main form called "add a projectDescription", which opens a new from and allow the user to add a new record to the " projectDescrition' combo box list. What my problem is that, the added record won't show in the combo box usless you close the form and reopen it again. Is there anyway i can refresh the combo box list without have to close the form.

Thanks.
Mar 11 '08 #1
4 2565
cori25
83
Hello...

1 - When you are looking at the row source, to the right is a box with 3 dots(...), click on this and you will now be in the query inside your form. Go to the field "Project Description" and sort ascending. *NOTE* Do not hit save, once you have made this change just close out the query and it will prompt you if you would like to save the changes, hit yes and you will be all set.

2 - I assume you have a command button to add the record, the best way to make this process easier for the end user is to create a macro that will close the form and then re-open the form when they click the "submit" button. Just go to the properties of the button and scroll down until you see On Click, then select the macro you just created.

Let me know if this helps.

Thanks
Mar 11 '08 #2
lulu123
12
cori, thanks for reply, but this doesn't really solve my problem.

1), my rowsource is part of the a vba code, where there was if condition as well. So, i can't really use the property box with the "..." to make it in oder. if i am writing this in VBA code, Do you have any other suggestions?

2), for the 2nd problem, i dont' really want to close and reopen the form. Because there is a filter on the form, where different user choose their own name first and then it took the user to the main form to enter their own data. If i do what you suggested, will it just open the form with everyone's record and not to the exact user?

Please give me more suggestion. Thanks.
Mar 11 '08 #3
cori25
83
I avoid using VBA when dealing with forms since it is much easier to just build behind the form. Therefore, no I do not know of any other way to have the data pull in ascending order because when I use vba I either pull the data from a query or a table and make sure it is ascending there.

As for refreshing the way I had mentioned, it will not open the form to everyone's information. It will open the form and each combo box will be blank, then the user will have to go through and pick there info from the drop down box and hit submit.

I have researched this in the past and this is the easiest approach. I usually include an exit button so that once they have completed adding information, the database will save all and close. Unless I am misunderstanding what you are asking, this will be the best approach.

Thanks
Mar 11 '08 #4
lulu123
12
Thanks for reply cori.

for the first problem, i find the solution. which the code as following

.RowSource = "select distinct [projectID],[projectDescription] " & "from Projects " & " where [projectID]=" & Me![projectID] & " order by projectDescription"



I avoid using VBA when dealing with forms since it is much easier to just build behind the form. Therefore, no I do not know of any other way to have the data pull in ascending order because when I use vba I either pull the data from a query or a table and make sure it is ascending there.

As for refreshing the way I had mentioned, it will not open the form to everyone's information. It will open the form and each combo box will be blank, then the user will have to go through and pick there info from the drop down box and hit submit.

I have researched this in the past and this is the easiest approach. I usually include an exit button so that once they have completed adding information, the database will save all and close. Unless I am misunderstanding what you are asking, this will be the best approach.

Thanks
Mar 12 '08 #5

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

Similar topics

3
by: B | last post by:
I know there are several ways to speed up combo boxes and form loading. Most of the solutions leave rowsource of the combo box blank and set the rowsource to a saved query or an SQL with a where...
1
by: Ryan | last post by:
Hello, I have a quick question (I hope). I have a form with a combo box and a multi-selection list box. The list box is based on a query. Users can select values from the cmbobox to add to...
2
by: Lucinda Roebuck | last post by:
I'm using Access 97 on a Windows XP computer. The combo box on the form "form1" will not refresh after a new name is added to the list. The "limit to list" properties for the combo box is set to...
6
by: lauren quantrell | last post by:
I have a combo box on a form. It uses the GotFocus event to poopulate the rowsource with a value list that is created on the fly in VBA. Fine and dandy, except, is a user opens another form and...
4
by: Bob Alston | last post by:
Some more, rather specific Access performance questions. IN a split front-end & back-end Access/Jet ONLY LAN situation, and with all query criteria fields and join fields indexed: 1. Is is...
3
by: Richard Hollenbeck | last post by:
I have a column in a table that currently only has one record. That column is set to combo box. I want the user to be able to lookup values from the column itself--the very same column--rather...
5
by: dkintheuk | last post by:
Is it possible to set (using VBA) the rowsource for a combo box but have that rowsource come from a pass-through query. I can obviously manually go into the rowsource property and define the...
7
by: bluray | last post by:
I have been fighting with this for a while, and I know someone on this board will be able to figure it out in a split second :) I have a List Box and a Combo Box. Based on the selection the user...
4
by: Wayne | last post by:
I've used a data field as the rowsource for a combo box many times. The main advantage that I see is that a separate table of say, "Customers" does not have to be constantly updated. When a new...
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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...
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...
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.