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

Combo Box auto-fill on Form Open

Hi there,

As it will be very apparent in a moment, I am very new to Access and learning on the fly. (Much fun, but frustrating at the same time)

I currently am trying to get a Combo Box that I created with the Combo Box wizard to run its After Update code on Form Open instead.

The current code looks like this:

Expand|Select|Wrap|Line Numbers
  1. Private Sub Combo10_AfterUpdate()
  2.     ' Find the record that matches the control.
  3.     Dim rs As Object
  4.  
  5.     Set rs = Me.Recordset.Clone
  6.     rs.FindFirst "[UserName] = '" & Me![Combo10] & "'"
  7.     If Not rs.EOF Then Me.Bookmark = rs.Bookmark
  8. End Sub
  9.  
Also, I have the Default Value of the Combo Box set to:

CurrentUser()

and the Row Source of the Box to:

SELECT Student_Information.UserName FROM Student_Information;


P.S. I have also tried putting CurrentUser() in the Control Source field.


More Details:

What I am trying to do is have the students access forms that they need to fill out, however I dont want the students looking at other students information, so I want it to populate the form based on the current users login name.

Am I going about this the wrong way, or am I just missing some really simple step.

Thanks in advance.
Aug 1 '07 #1
1 4550
Rabbit
12,516 Expert Mod 8TB
1) On Open occurs before any values are loaded. On Load occurs after the values are loaded.

2) This will not prevent them from going to other records. Instead, you want to use the Filter property of the form to only show those records that relate to the student.
Aug 1 '07 #2

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

Similar topics

0
by: Bill K | last post by:
Does the vb.net combo box control have the auto complete/expand feature like the Access combo box - where you begin typing in the conbo box and the first possible choice appears? If so, how do...
2
by: Dwight | last post by:
Help ! Have a combo box in accsess, with 6 fields, I want each to show up a different colour when they ar selected/viewed. I have tried the following code but seems to have no affect can anyone...
2
by: Jim Devenish | last post by:
I have a combo box with Auto Expand and Limit to List both set to 'yes'. When I type 'C' I correctly get: C J Valeting When I type 'CO' I get: Cogent Seating Ltd again correct BUT when I go...
9
by: Bob Alston | last post by:
I have a drop down combo box that gives the user to enter an item not in the list by adding it to the list. The list is a table. It works fine on Access2003 but fails on Access2002/XP. ON XP, it...
0
by: VenuGopal | last post by:
hi, i have implemented a MultiColumn Combo by overriding thr Combo Box's DropDown Event. In the Event i have populated a DataTable to contain the Necessary MultiColumns. Now i need to implement...
1
by: pemigh | last post by:
In a prior posting (too old to reply directly), Jim Devenish described exactly what my client has seen, both in terms of AutoExpand behaving oddly and the way that caps lock relates to the...
2
by: Abdhul Saleem | last post by:
Hi, Any code snippet or help link available on how to auto resize the dropdown list part of the combo(<select>) ? Or, is there any alternative techniques for displaying the full lenth text...
3
by: joseph.mccastlain | last post by:
Hello All, I am a new user to Access. I am currently designing a database consisting of four tables for multiple users. Rather than bore you with the goals and such, here is what I am...
3
by: John | last post by:
AC2007 I changed my combo's row source and then the autocomplete stopped working. The combo is two columns, bound to the first. First column is primary key (ID). Second column is a...
3
by: mahesh123 | last post by:
Hi Folks, I want Help regarding the Auto search in the Combo Box. When I am pressing the characters it will move to the appropraite words in the Combo Box. For Example if the Combo Box filled...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...

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.