Placein the value of a combo Box column into a text box

This should be easy! Here is the code...

Private Sub Combo18_AfterUpdate()

Me![SchoolID] = Me!Combo18.Column(1)
Me![Counselor Name] = Me!Combo18.Column(2)

End Sub

The problem is that it will not accept the first line:

Me![SchoolID] = Me!Combo18.Column(1)

If I move it around it is perfectly willing to place the counselor's name 
into the correct text box, but for the schoolID it says I have to save the 
record first.  Anyone have any idea why???

I've checked and rechecked spelling, properties, etc!

Thanks for any help you can give.
0
Utf
1/3/2008 3:52:02 PM
access.forms 6864 articles. 2 followers. Follow

6 Replies
839 Views

Similar Articles

[PageSpeed] 6

On Thu, 3 Jan 2008 07:52:02 -0800, Betsy <Betsy@discussions.microsoft.com>
wrote:

>This should be easy! Here is the code...
>
>Private Sub Combo18_AfterUpdate()
>
>Me![SchoolID] = Me!Combo18.Column(1)
>Me![Counselor Name] = Me!Combo18.Column(2)
>
>End Sub
>
>The problem is that it will not accept the first line:
>
>Me![SchoolID] = Me!Combo18.Column(1)
>
>If I move it around it is perfectly willing to place the counselor's name 
>into the correct text box, but for the schoolID it says I have to save the 
>record first.  Anyone have any idea why???
>
>I've checked and rechecked spelling, properties, etc!
>
>Thanks for any help you can give.

Is SchoolID an Autonumber field? What's the Bound Column and Control Source of
Combo18? What's the Recordsource of the form?

I worry that you may be storing information redundantly: why is it necessary
to store both these fields? Could the Counselor Name be looked up using a
query instead?

             John W. Vinson [MVP]
0
John
1/3/2008 6:29:19 PM
I don't need to save the counselor name and it can be looked up using a 
query.  the user wants to be able to see it.  I guess she could see it on the 
report rather than the form.

She needs to be able to choose a school and enter some information about the 
school.  she has given me an excel spreadsheet she's been using and wants her 
interface to look as alike the spreadsheet as possible.  

The value I need to store in the table is the SchoolID.  Since wirting this 
I think I've conquered that problem.  Just needed to step away and rethink 
what I was doing.  but I still don't understand why the code wasn't working.  
School ID was not an auto-number in this case.  It was pulled from a query 
using a field linked to the School table.  It was, however, the bound column. 
 Would that have something to do with it?  Just trying to learn at this point.

thanks for your help.


"John W. Vinson" wrote:

> On Thu, 3 Jan 2008 07:52:02 -0800, Betsy <Betsy@discussions.microsoft.com>
> wrote:
> 
> >This should be easy! Here is the code...
> >
> >Private Sub Combo18_AfterUpdate()
> >
> >Me![SchoolID] = Me!Combo18.Column(1)
> >Me![Counselor Name] = Me!Combo18.Column(2)
> >
> >End Sub
> >
> >The problem is that it will not accept the first line:
> >
> >Me![SchoolID] = Me!Combo18.Column(1)
> >
> >If I move it around it is perfectly willing to place the counselor's name 
> >into the correct text box, but for the schoolID it says I have to save the 
> >record first.  Anyone have any idea why???
> >
> >I've checked and rechecked spelling, properties, etc!
> >
> >Thanks for any help you can give.
> 
> Is SchoolID an Autonumber field? What's the Bound Column and Control Source of
> Combo18? What's the Recordsource of the form?
> 
> I worry that you may be storing information redundantly: why is it necessary
> to store both these fields? Could the Counselor Name be looked up using a
> query instead?
> 
>              John W. Vinson [MVP]
> 
0
Utf
1/3/2008 7:14:00 PM
Was the combobox itself unbound?

0
Ron2006
1/3/2008 8:09:10 PM
Yes

"Ron2006" wrote:

> Was the combobox itself unbound?
> 
> 
0
Utf
1/3/2008 8:16:00 PM
On Jan 3, 1:16=A0pm, Betsy <Be...@discussions.microsoft.com> wrote:
> Yes
>
>
>
> "Ron2006" wrote:
> > Was the combobox itself unbound?- Hide quoted text -
>
> - Show quoted text -

Well, that shot that approach. I was thinking that maybe the combobox
was bound to the school ID therefore trying to move the combobox value
to the field it was already bound to would give you a conflict.


hmmmm

0
Ron2006
1/3/2008 8:47:35 PM
Thanks.  I don't know what I did wrong, but I did it another way at this 
point it is working.  Just a Conundrum and I thought someone else would see 
what I'm not seeing.

Thanks,

"Ron2006" wrote:

> On Jan 3, 1:16 pm, Betsy <Be...@discussions.microsoft.com> wrote:
> > Yes
> >
> >
> >
> > "Ron2006" wrote:
> > > Was the combobox itself unbound?- Hide quoted text -
> >
> > - Show quoted text -
> 
> Well, that shot that approach. I was thinking that maybe the combobox
> was bound to the school ID therefore trying to move the combobox value
> to the field it was already bound to would give you a conflict.
> 
> 
> hmmmm
> 
> 
0
Utf
1/3/2008 8:59:02 PM
Reply:

Similar Artilces:

Msg Box question
I have several reports that are run by queries. Most of these queries have date range parameters that must be entered by the operator. I have one query that I ask only for a week ending date. This is driving mgmt nuts because they are used to entering a beginning date first, followed by the ending date. I hard wire the beginning date myself. How can I get a msg box to pop up to tell people what my hardwired date is? Ideas? I believe you're describing pop-up Parameter Input Boxes, not message boxes. One option is to use a form to enter the parameter values rather than simply h...

Combo Box List Content Control
I want both the code and corresponding English translation to appear in the dropdown box. The codes are in col A, and the translations are in col B. Under Properites, ListFillRange I have entered: Jobs!A2:B200. Only column A is shown in the dropdown box. Also, when I select one of the dropdown options I get a VB error with my "Jobs!A2:B200" displayed in the VB code. Please tell me what I'm doing wrong. Thanks. Did you change the columncount property to 2? Be aware that the both columns will appear when you click on the dropdown arrow, but only one value will appear in ...

How to Exclude Account from Budget when Option Check Box is Inactive?
I want to exclude the income in my retirement accounts from being included in the budget planning and being shown as income in monthly reports. In the account details, the option is "checked" to include in budget planner but the lined is grayed out and in-active and thus I can't uncheck it. How to uncheck? ...

Go To the next empty cell in Column A
Using Vista and Excel 2007, I will be constructing a mailing list with 10 columns. In the first empty row of column A will be added a new name for the list. With 10 columns it is not possible to view Column A from Column L on screen. With hundreds of names to add to the list, I need a fast way to go to the next empty cell in column A to add the next name.. I am familiar with tables in Access where there is an icon that will take me to the next empty cell in column A. Is there a similar one stroke command to take me to the next empty cell in column A from anywhere in an Excel ...

Text String to Unicode
Hi, How do I convert a text string (from a text file) that has escaped unicode charactes (\u0635\u0641\u0627\u0631) to unicode chars? Thanks, Guilherme R. Rolim Look at macros A2W etc. -- Ajay Kalra [MVP - VC++] ajaykalra@yahoo.com "Guilherme R. Rolim" <grrolim@yahoo.com.br> wrote in message news:OXR7gzxkDHA.988@TK2MSFTNGP10.phx.gbl... | Hi, | | How do I convert a text string (from a text file) that has escaped unicode | charactes (\u0635\u0641\u0627\u0631) to unicode chars? | | Thanks, | | Guilherme R. Rolim | | | | I'll try to put some more details, mayb...

moving text from a word document to excel
I'm moving a large amount of text from word documents to an excel spreedsheet, and I have a few questions: 1. When I copy/paste text from the document to the spreedsheet, the text will sometimes expand the cell very large. How can I keep all the cells the same size? 2. When I click on a cell that has text in it to read it, sometimes it will only show the text in a long downwards column, whereas other times it shows it as a big 'blurb' to the right side (which makes it easier to read). How can I set it up so it is not in a long column? 3. How can I insert cells without h...

How do I convert time format to text?
I have a cell with a formula of =text(c3-b3,"h:mm") as the difference from cell b3 and c3. Assume the result is 5:00. I need to minus another cell value that is formatted as general text. eg. =text(c3-b3,"h:mm")-G3 Thanks....Andrew Hi Andrew- Try the VALUE() fx and format that cell with your choice of Time Formats. HTH |:>) "Andrew" wrote: > I have a cell with a formula of =text(c3-b3,"h:mm") as the difference from > cell b3 and c3. Assume the result is 5:00. I need to minus another cell value > that is formatted as general text. ...

How can I line up 2 columns with similar information?
I have 2 columns with names in each and I'd like to line them up next to each other. I think we'll need more information, Kathy. I don't understand what you're trying to do. Can you give exactly what's up? ************ Anne Troy www.OfficeArticles.com "Kathy" <Kathy@discussions.microsoft.com> wrote in message news:A5C0BC96-7E27-4C55-89A3-03513FC0D409@microsoft.com... >I have 2 columns with names in each and I'd like to line them up next to >each > other. Column A has employee number, Column B has the same employee numbers but has addi...

List Boxes #2
Can someone tell me how to correct the following code so that both columns in the listbox will be updated? Only the first column distplays Dim MyArray() ReDim MyArray(mycount, 1) usrGLDist.lstOutput.ColumnCount = 2 For i = 0 To rst.Count - 1 MyArray(i, 0) = rst.Value("descr") MyArray(i, 1) = rst.Value("pcamt") rst.MoveNext Next i 'Load ListBox1 usrGLDist.lstOutput.List() = MyArray Richard wrote : > Can someone tell me how to correct the following code so that both > columns in the listbox will be updated? Only the first col...

How to make a pop up combo box like calendar pop up
I have a form with a series of text boxes for entering order information. But because i want to be able to select more than one entry from a combo box, I thought it would be nice to have each item added to a text box and for neatness and ease of programmability, I'd like it if a combo box would pop up beside the text box much like the date picker pops up when entering a date field. Then each item selected could get appended to what's already in the text box. So my questions are: Does such a thing already exist and i can just download it and add it to my database? ...

autofit: cell height expands with text entered?
For a form: can a user enter mass quantities of text in a cell and have the cell depth expand so it fits? does Merging Cells limit this ability? I made a giant cell to handle the text the user might enter. I can't figure out where to set this... I have copied & pasted formatting from one worksheet to another without luck. Thanks. Sandy Merged cells don't adjust rowheight for wrapped text (like non-merged cells do). Jim Rech wrote a macro called AutoFitMergedCellRowHeight that you may like: http://groups.google.com/groups?threadm=e1%241uzL1BHA.1784%40tkmsftngp05 Sandy wrote:...

Select last value
I am trying to select the last (bottom) value on a one-column list. I am using the COUNT function to designate the bottom value that is not zero, and the CHOOSE function to select the designated value. But, I can't make that work. Help appreciated. try =match(a number larger than possible,your range) -- Don Guillett SalesAid Software donaldb@281.com "Carl" <c@invalid.com> wrote in message news:eciLEKsvFHA.3236@TK2MSFTNGP14.phx.gbl... > I am trying to select the last (bottom) value on a one-column list. I am > using the COUNT function to designate the bottom va...

IV40100.MAINLOCN
I am trying to determine where the contents of IV40100 (Inventory Control Setup) are determined. I have ocated most of them from the Inventry Control Setup window/form, but cannot locate where the contents of the following fields are set: MAINLOCN (Main Location) DISABLEAVGPERPADJ (Disable Avg Perpetual Valuation Adjustments) DISABLEPERPADJ (Disable Perpetual Valuation Adjustments) Does anyone know from what where these values are set without using Query Analyzer, or are these fields that are not currently being used by Dynamics-GP? The resource descriptions indicate tha...

How do I make a particular column required in Excel? #2
Our NPO is creating a reimbursement chart in Excel. We're trying to make it so that if employees do not fill in one particular column entitled "Projects," they will get an error or will be unable to have a final sum filled in. Is there any way I can make this particular column required so that if it is not filled in, the chart will not complete properly? Thank you in advance for any advice or help--I'm a bit of a novice to this! ...

How do I increase size of text when typing?
I am using Word 2003 and with Word 2000 I could enlarge the size of the print before typing to increase to 150% but cannot find how to do this in the 2003 version. The print on the screen is now about a 10 which is too small for comfort. View | Zoom. -- Suzanne S. Barnhill Microsoft MVP (Word) Words into Type Fairhope, Alabama USA http://word.mvps.org "Sufimai" <Sufimai@discussions.microsoft.com> wrote in message news:1125090F-6AB0-404F-8B1C-E5EAF06917F8@microsoft.com... >I am using Word 2003 and with Word 2000 I could enlarge the size of the >p...

sp_columns does not return NVARCHAR data type columns
Hi, our SQL Server Version is 2000 SP4. For several days the SP "sp_columns" does not return NVARCHAR data type columns any more. I reviewd the SP "sp_columns" and it seems, that the used SP "spt_datatype_info" does not return that type any more. A second production server returns that column type. The SP "sp_columns" is used by the ODBC-Driver to determine the table columns. Any suggestions? Thanks a lot, Nils Ok, my fault, it seems that "spt_datatype_info" is a table and there is no NVARCHAR row. After insert...

How do I create a running subtraction column?
In other words, how do I create a column which subtracts from the preceeding cell? Hi you may provide some more details what you're trying to do exactly. Maybe post some example rows -- Regards Frank Kabel Frankfurt, Germany aschneider wrote: > In other words, how do I create a column which subtracts from the > preceeding cell? If you want the balance in column B, and you are making entries in column A which are to be subtracted from the balance, put the starting balance in B1. In B2 put the formula =B1-A2 On Mon, 4 Oct 2004 08:35:08 -0700, "aschneider" <aschne...

center text when conditional format applied
Textbox control on Access 2007 form lost its centered alignment when conditional formatting is applied. This did not happen in previous versions of Access. I tried using format painter to apply conditional formats from a control created in an earlier version, but this failed. The control created in the earlier version then lost it's centering after saving in Access 2007. -- Roy Handy Interesting. I tried to replicate this behaviour but failed, it all worked as it should. Try revisiting your form after applying the conditional formatting and resetting the text box to center text. ...

Bold text appears in print preview but does not print bold
I am working on a menu in Publisher. In print preview, all text in bold appears bold, but when I actually print, portions of the bold text does not print in bold. This problem applies to all text within specific text boxes. For some text boxes the bold prints and for some it doesn't. Any suggestions would be enormously appreciated. What version Publisher? Don't know if that makes a difference however. If you look in the font directory in the control panel you will see a separate font for bold, italic, condensed and so on for fonts like Times New Roman and Arial. If you use ...

Do a calculation in cells with text data format
I have a few columns of cells having a mixed data format of number and text. Is it possible to convert the first row of numbers in text data format for further calculation? Your guidance to accomplish it is appreciated. Thanks, Ray Example? -- Regards, Peo Sjoblom "Ray" <NoSpam-ZQLi@GMail.com> wrote in message news:ei$Jbmy$FHA.216@TK2MSFTNGP15.phx.gbl... > I have a few columns of cells having a mixed data format of number and text. > Is it possible to convert the first row of numbers in text data format for > further calculation? Your guidance to accomplis...

Text to Date
I have been given a database dump (thousands of rows) that put the dates in a text format like this: Aug/11/2009 Is there any way to put this into a date format? Even if it means creating a new field breaking it up and doing some extra steps. Thanks. Change to appropriate cell reference: =DATEVALUE(SUBSTITUTE(A1,"/",", ")) -- Best Regards, Luke M "PAL" <PAL@discussions.microsoft.com> wrote in message news:2E5E64F4-8B6A-44D5-95C9-8FD45A326DB3@microsoft.com... >I have been given a database dump (thousands of rows) that put the da...

Check box to click on in excel or word
I am needing to add a shadow outlined box that you can click on in a document in either word or excel. I did it in the old excel but I'm having difficulty in the new Microsoft Office. The old and the new Office?...which versions would that be...nevermind...actually you should ask this in an Excel newsgroup this one is for Publisher (a desktop publishing program). -- ~~~~~~~~~~~~~~~~~~ Rob Giordano Microsoft MVP Expression Web "ThePools" <ThePools@discussions.microsoft.com> wrote in message news:24A86070-537B-404A-A39B-CFC06CAECBA0@microsoft.c...

GP ver 10 SP 2
Hi Folks I am testing in the Fabrikam company and I have been able to duplicate an error that is happening at my client in their live data. I capture a PO for stock code 100XLG for a qty of 2 at an extended cost of ..25c. The system displays the .25c as the extended cost but it displays ..26c as the 'Remaining PO Subtotal' value. The PO on 'blank' form also prints up a total of .26c. It's fine if I use an extended cost of .24c or .26c and I understand that as the maths division works out fine. Does anyone have a solution to this problem please? Thankx in advan...

Having trouble with combo boxes.
Is it possible to to use Multiple Combo Boxes to narrow down choices for specfic data in a worksheet? Example: User Selects from choices in Combo Box 1, the choice from that gives the choices for Combo Box 2, which gives you the choices for Combo Box 3? All the Data to fill Combo Box 3 is in an excel worksheet in the same workbook as the User Form. I have the worksheet set up as named ranges "CLLI_GA", etc... Combo box 1 = Customer (Approx 8 customers) Combo box 2 = State (Approx 9 States) Combo box 3 = Office (400 Offices per State) I got the first...

secondary y-axis for graph "column"
Hi! Chart type XY (scatter) > allows a secondary Y-axis column > does not allow this, or does it? I would like so, how to solve this problem? Thanks in advance! tom Hi, sorry, I understand why (risk of visual overlap) and and was able to create a secondary Y-axis but how to solve this? thanks! tom "tom ossieur" wrote: > Hi! > > Chart type > XY (scatter) > allows a secondary Y-axis > column > does not allow this, or does it? I would like so, how to > solve this problem? > > Thanks in advance! > > tom See htt...