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

AfterUpdate Event for auto fill

418 256MB
I have a table called tblFunds with these fields: FundID (PK / Auto), FundNo (Text), FundDescr(Text), GrantNo (Text).

In a form I have several fields that came from different tables. Two of the fields came from the tblFunds: FundID (Name: cboFund) and GrantNo (txtGrant). I have this After Update Event for FundID:
Private Sub cboFund_AfterUpdate()
Me.txtGrant = Me.cboFund.Column(3)
End Sub
But it’s not populating the Grant Number upon entering the fund number and leaving it blank. What am I doing wrong?

Thanks.
Apr 28 '09 #1
18 4598
ChipR
1,287 Expert 1GB
I would guess that it is because the combo box columns are zero indexed. Should it be .Column(2)?
Apr 28 '09 #2
MNNovice
418 256MB
I have:
Bound Column: 1
Column Counts: 3
Column Heads: No
Column Width: 0”;1”;1”;
Apr 28 '09 #3
ChipR
1,287 Expert 1GB
So you have .Column(0), .Column(1), and .Column(2)
Apr 28 '09 #4
MNNovice
418 256MB
Are you suggesting I have wrong column widths? Since the table has four columns and I want the 4th column to pull the data from (which the GrantNo) the column widths should be 0";1";1";1";

I don't think I am understanding. Forgive me but I am new at this things.

Thanks.
Apr 28 '09 #5
ChipR
1,287 Expert 1GB
The table may have four columns, but the combo box does not. You may need to change or redo the combo box.
Apr 28 '09 #6
MNNovice
418 256MB
My combo box on the form is called: cboFund. Post #3 refers to what is shown on Format Tab of cboFund.

Do I read you correct? Thanks.
Apr 28 '09 #7
ChipR
1,287 Expert 1GB
Right, your combo box has 3 columns. If you want to get the number in the third comlumn, you want cboFund.Column(2).
Apr 28 '09 #8
MNNovice
418 256MB
I changed it to read:
Expand|Select|Wrap|Line Numbers
  1. Private Sub cboFund_AfterUpdate()
  2. Me.txtGrant = Me.cboFund.Column(2)
  3. End Sub
End result was the same. No data in txtGrant
Apr 28 '09 #9
ChipR
1,287 Expert 1GB
What's the data source for cboFund?
Apr 28 '09 #10
MNNovice
418 256MB
I have a table called tblFunds with these fields: FundID (PK / Auto), FundNo (Text), FundDescr(Text), GrantNo (Text).

cboFund is pulling data from FundID
Apr 28 '09 #11
ChipR
1,287 Expert 1GB
What's in the other columns then?
Apr 28 '09 #12
MNNovice
418 256MB
Are you asking the data in tblFunds?

FundID: PK (Auto)
FundNo: Text (Let's say Fund number is 872)
FundDescr: Text (in this example: 872 is UPA)
GrantNo: Text (in this example: MN040012)
Apr 28 '09 #13
NeoPa
32,556 Expert Mod 16PB
M,

Your GrantNo field is not included in your ComboBox control, so it is in none of the columns.
Apr 28 '09 #14
MNNovice
418 256MB
NeoPa:

I thought that's what I did. Please see post #5. And thanks for keeping an eye for this novice.
Apr 28 '09 #15
NeoPa
32,556 Expert Mod 16PB
@ChipR
If you answer this question (the property we're looking for is Row Source), then we can illustrate why it's failing, and what to do to fix it.
Apr 28 '09 #16
NeoPa
32,556 Expert Mod 16PB
@MNNovice
This (Column widths) won't effect what data is returned. Merely what is shown on screen when the control is dropped down.

Please see earlier post for how to make progress.
@MNNovice
Always a pleasure.
Apr 28 '09 #17
MNNovice
418 256MB
NeoPa;

I knew I was doing something really "goofeey". Thank you. It's working now. But tell me how did you figure that this was the problem? Man!! you're too good. No wonder you're the ADMINISTRATOR...LOL

Thanks.

M
Apr 28 '09 #18
NeoPa
32,556 Expert Mod 16PB
Always happy to help M, but to be fair, I suspect Chip was trying to lead you in the same direction too.

Glad you got it resolved anyway :)
Apr 28 '09 #19

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

Similar topics

3
by: jdph40 | last post by:
In Access 2002, I designed a simple database for our Safety department to enter results of a survey. There are 41 true/false statements. I have a main form called frmSurvey with a subform called...
2
by: jv | last post by:
Hello, I have a Service Cancellation form that contain a CancelDate text box. The text box has an AfterUpdate event that perform a few calculations. This works fine. However, next to the text...
3
by: Tommy | last post by:
Sometimes, I use "TextBox_TextChanged" event to auto fill in other text box once user tab out from the search box. i.e. connect to database and use the field to search out record and then fill in...
3
by: gazelle04 | last post by:
Which happens first AfterUpdate event of a form or Clicked event of a button on a form. I have these codes on an AfterUpdate of a form: If UpdateDone = True Then ...
5
by: EManning | last post by:
I'm developing an unbound form with a series of questions on it. Each question is either a text box or an option group. I have coding in the AfterUpdate event of each control to highlight the...
0
by: Boki | last post by:
Hi All, I am creating a program that performs "auto fill in" and "auto submit" functions. I will feed the webbrowser the target URL, however, I don't know how to auto fill in text and submit....
4
by: bcallnan | last post by:
Hello All- I am trying to reference a subform's afterupdate event that is 3 deep and am having some trouble getting it to work. The control is a combo box and i cannot seem to trigger the...
12
by: Gerhard | last post by:
This is bizarre... Im having problems with the combobox AfterUpdate event: Im running Access 2003. I created an unbound combobox with 3 columns on a form. The Row Source is from a table....
3
mshmyob
by: mshmyob | last post by:
I am scratching my head over this. I have a combo box control where the afterupdate event or even the onchange event keeps runnning twice. Below is some simple code to emulate the problem I am...
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: 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
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: 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
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.