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

Need Help with combo box display

Hi,

I have a form and i have a combo box that gets loaded with the last name and first name being concatenated at the time of loading into the combobox and i select from that list ...

So the problem is if i select any name then it is breaking up and moving into a second line in the combobox..

Example:

Jason Meyers ----- I select this


Result

Jason
Meyers ---- I dont want it to be like that


I want it to be in the same line as it was displayed and need to remain like that after selection.....


Desired Result:

Jason Meyers




Waiting for help

Thanks
Jason.
Oct 25 '07 #1
9 1657
nico5038
3,080 Expert 2GB
Can you post the query that's used to fill the combobox ?

Nic;o)
Oct 27 '07 #2
Can you post the query that's used to fill the combobox ?

Nic;o)
Expand|Select|Wrap|Line Numbers
  1. Private Sub cboEmployerGroupName_LostFocus()
  2. Dim RsGrpID As DAO.Recordset
  3. Dim RsAgyID As DAO.Recordset
  4. Dim RsClient As DAO.Recordset
  5.  
  6. Set RsGrpID = Db.OpenRecordset("SELECT Grp_ID,Grp_SAddressLine1,Grp_SAddressLine2,Grp_City,Grp_State,Grp_ZipCode,Commission,StateLocalGovtEmp,Agency_ID,Agent_ID,ClientManagerID FROM EmployerGroupDetails WHERE Grp_Name ='" & Trim(cboEmployerGroupName) & "'")
  7. If RsGrpID.RecordCount < 1 Then MsgBox "Records Not Available...": Exit Sub
  8. GrpID = RsGrpID.Fields(0)
  9. txtAddress = RsGrpID.Fields("Grp_SAddressLine1") & " " & RsGrpID.Fields("Grp_SAddressLine2")
  10. txtCity = RsGrpID.Fields("Grp_City")
  11. txtState = RsGrpID.Fields("Grp_State")
  12. txtZipCode = RsGrpID.Fields("Grp_ZipCode")
  13. txtCommission = RsGrpID.Fields("Commission")
  14. txtStateLocalGovtEmp = RsGrpID.Fields("StateLocalGovtEmp")
  15.  
  16. Set RsAgyID = Db.OpenRecordset("SELECT Agency_Name FROM Agency WHERE Agency_ID=" & Val(RsGrpID.Fields(8)))
  17.  
  18. txtAgencyName = RsAgyID.Fields(0)
  19.  
  20.  
  21.  
  22. Set RsClient = Db.OpenRecordset("SELECT ClientManagerName FROM ClientManager WHERE ClientMgrID =" & Val(RsGrpID.Fields(10)))
  23.  
  24. txtClientManager = RsClient.Fields(0)
  25.  
  26. End Sub
  27.  
So here iam trying pull the names from the respective tables...My database is normalized and iam using the ID's to get the respective data....


So when the names are being populated in the text boxes they are appearing in 2 lines....I want them in one straight line inside the text box.....

Thanks
Jason.
Oct 29 '07 #3
nico5038
3,080 Expert 2GB
When it's just the filling of the textbox try:
Expand|Select|Wrap|Line Numbers
  1. txtClientManager = Replace(RsClient.Fields(0),vbCRLF," ")
  2.  
The original field will have the carriage return (vbCRLF) embedded. What puzzled me is the fact that such a field is also used in the combobox, else the WHERE in your first recordset would't work..

Nic;o)
Oct 29 '07 #4
When it's just the filling of the textbox try:
Expand|Select|Wrap|Line Numbers
  1. txtClientManager = Replace(RsClient.Fields(0),vbCRLF," ")
  2.  
The original field will have the carriage return (vbCRLF) embedded. What puzzled me is the fact that such a field is also used in the combobox, else the WHERE in your first recordset would't work..

Nic;o)
Hello sir,

Thanks for the reply i will try that ....

I have one more question....

I want the STATE field on my form to accept on 2 chracters like NY,CA etc.....

How do i do that ????

How do i convert all the matter that is entered onto the form to be in capitals.....


Waiting for reply....
Thanks
Jason...
Oct 29 '07 #5
nico5038
3,080 Expert 2GB
For a State field you define a tblState holding the fields StateShort and StateLong.
Now define a combobox and let the user select from there the state from the longname and store the short (2 character) value.
The combowizard will guide you.

Nic;o)
Oct 29 '07 #6
For a State field you define a tblState holding the fields StateShort and StateLong.
Now define a combobox and let the user select from there the state from the longname and store the short (2 character) value.
The combowizard will guide you.

Nic;o)
Hello sir,

Thanks for all ur help....

I am building my application using access as the database and 6 people will need to access it and work on it .....So right now as iam the only one using... it is on my system ....so if i hand it over .....how will it be possible for all these people to work on it at the same time .....Because if soem one updates it then those changes should be visible to others also...i mean the updated records....so how do i do that .....what softwares do we need for such a thing......some one was suggesting VSS or CVS ...Is that a right option....

waiting for ur reply....
Thanks
Jason....
Oct 30 '07 #7
nico5038
3,080 Expert 2GB
Access will support multiple users when the database is set in "Shared" mode. (Default setting in the Database Options form)

The best thing is however to use a "splitted" database. Just check the Helpfile (F1) for the Database split utility. This will allow to change the front-end without havng to mind the production data in the tables.

Nic;o)
Oct 30 '07 #8
Access will support multiple users when the database is set in "Shared" mode. (Default setting in the Database Options form)

The best thing is however to use a "splitted" database. Just check the Helpfile (F1) for the Database split utility. This will allow to change the front-end without havng to mind the production data in the tables.

Nic;o)
Hello sir,

This is Jason Again.....Thanks for all the suggestions u have given so far....I have a question.....

I have 2 forms and say the 1 st form is the "EMP" ....

2nd form is the "FORM1"....

so i have a button on "FORM1" which was cofigured through the Wizard to open "EMP" FORM....But this "FORM1" in the background should close as i move to the "EMP" form....

This is how i changed the code...Its not working....gives this error....

Wrong number of arguments or invalid property assignment....


Private Sub Command1_Click()
On Error GoTo Err_Command1_Click

Dim stDocName As String
Dim stLinkCriteria As String
Dim stDocName1 As String
Dim stLinkCriteria1 As String

stDocName = "Emp"
DoCmd.OpenForm stDocName, , , stLinkCriteria
stDocName1 = "Form1"
DoCmd.Close stDocName1, , , stLinkCriteria1

Exit_Command1_Click:
Exit Sub

Err_Command1_Click:
MsgBox Err.Description
Resume Exit_Command1_Click

End Sub


Please help waiting for ur reply.....
Thanks...
Jason...
Nov 8 '07 #9
nico5038
3,080 Expert 2GB
Hi Jason,

Best to start a new thread for this.

We like to keep questions and answers as clear as possible for future readers that might find a Q when Googling. It also attracts more attention from the experts, as I can be on a holiday :-)

Nic;o)
Nov 8 '07 #10

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

Similar topics

3
by: ssb | last post by:
Hello, This may be very elementary, but, need help because I am new to access programming. (1) Say, I have a column EMPLOYEE_NAME. How do I fetch (maybe, cursor ?) the values one by one and...
3
by: google | last post by:
I have a database with four table. In one of the tables, I use about five lookup fields to get populate their dropdown list. I have read that lookup fields are really bad and may cause problems...
2
by: Uninvisible | last post by:
I have put together a db for a law firm to keep track of counterfeit activities. There are four parent tables: tblContact tblTransaction tblAction tblFile I have created a form,...
2
by: pmcguire | last post by:
OK. So I've been to http://www.syncfusion.com/FAQ/WinForms/FAQ_c44c.asp and learned a lot about what I might do with a datagrid. But I'm STILL not able to do what I want to do. I want to be able...
2
by: http://www.visual-basic-data-mining.net/forum | last post by:
Hi... Say i have this string call "data" in Form1, this string contains number "5" value.... how do i pass this string to the Form2 and compare with the combo box items... The combo box ...
10
by: thh108688 | last post by:
Hi all, I have got a question here perhaps someone can provide me some good information or suggestion. In the Access Form I have created 2 combo box one is Activity combo box, the other is...
7
by: tranzit | last post by:
hi i have a form with a combo box and two text boxes on it. i want it set up so when a selection is made from the combo box the two text boxes will display the corresponding data from the table. ...
7
by: Rnykster | last post by:
I know a little about Access and have made several single table databases. Been struggling for about a month to do a multiple table database with no success. Help! There are two tables. First...
4
by: Gilberto | last post by:
Hello, I have a couple of forms using the code to FIND AS YOU TYPE from Allen Browne (http://allenbrowne.com/AppFindAsUType.html). It worked PERFECTLY until yesterday when i splitted the db into...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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
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.