473,785 Members | 2,137 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Enter value into combo box with code?

I have a form with a combo box for last name. It shows the record
with whatever name I select in the combo box. I am trying to get the
same results with code when I open the form by using a value from
another form.

I tried

Me.RecordsetClo ne.FindFirst "[LastName] = '" &
Forms!SelectNam e![snLastName] & "'"
Me.Bookmark = Me.RecordsetClo ne.Bookmark

Am I just missing something small or is this not possible?

Thanks for any help.
Nov 13 '05 #1
7 4339
Rog
You don't need the single quotes here.
Try: Me.RecordsetClo ne.FindFirst "[LastName] = " &
Forms!SelectNam e![snLastName]

Nov 13 '05 #2
On 11 Jan 2005 00:29:50 -0800, "Rog" <de********@sta te.gov> wrote:
Me.RecordsetCl one.FindFirst "[LastName] = " &
Forms!SelectNa me![snLastName]

Thanks for the FAST reply. I tried this and received the following
error message.

Run-time error '438':

Object doesn't support this property or method

I copied and pasted the code you sent so I'm stumped. ;-(
Nov 13 '05 #3
ShyGuy <sh****@shytown .com> wrote:
I tried this and received the following
error message.

Run-time error '438':

Object doesn't support this property or method


What library references do you have set? If you haven't already, try
selecting DAO version 3.6 (from Tools/References in a module window).

Regards,
Keith.
www.keithwilby.com
Nov 13 '05 #4
try:
Me.RecordsetClo ne.FindFirst "[LastName] = '" &
Forms!SelectNam e![snLastName].Text & "'"
If Not Me.RecordsetClo ne.NoMatch Then
Me.Bookmark = Me.RecordsetClo ne.Bookmark
End If
"ShyGuy" <sh****@shytown .com> ¦b¶l¥ó
news:9m******** *************** *********@4ax.c om ¤¤¼¶¼g...
I have a form with a combo box for last name. It shows the record
with whatever name I select in the combo box. I am trying to get the
same results with code when I open the form by using a value from
another form.

I tried

Me.RecordsetClo ne.FindFirst "[LastName] = '" &
Forms!SelectNam e![snLastName] & "'"
Me.Bookmark = Me.RecordsetClo ne.Bookmark

Am I just missing something small or is this not possible?

Thanks for any help.

Nov 13 '05 #5
On 11 Jan 2005 10:19:47 GMT, Bilk Whitey
<ke*********@Aw ayWithYerCrap.c om> wrote:
ShyGuy <sh****@shytown .com> wrote:
I tried this and received the following
error message.

Run-time error '438':

Object doesn't support this property or method


What library references do you have set? If you haven't already, try
selecting DAO version 3.6 (from Tools/References in a module window).

Regards,
Keith.
www.keithwilby.com


DAO version 3.6 is checked..
Nov 13 '05 #6
This didn't work either. With the "Text" after [snLastName] I got the
following..

You can't reference a property or method for a control unless the
control has the focus.

Without the "Text" I don't get the error but nothing happens. The
form opens to the first record. I even tried puttin the code in a
command button. Nothing. ;-(

On Tue, 11 Jan 2005 22:45:59 +0800, "hwangtw" <hw*****@seed.n et.tw>
wrote:
try:
Me.RecordsetCl one.FindFirst "[LastName] = '" &
Forms!SelectNa me![snLastName].Text & "'"
If Not Me.RecordsetClo ne.NoMatch Then
Me.Bookmark = Me.RecordsetClo ne.Bookmark
End If
"ShyGuy" <sh****@shytown .com> ¦b¶l¥ó
news:9m******* *************** **********@4ax. com ¤¤¼¶¼g...
I have a form with a combo box for last name. It shows the record
with whatever name I select in the combo box. I am trying to get the
same results with code when I open the form by using a value from
another form.

I tried

Me.RecordsetClo ne.FindFirst "[LastName] = '" &
Forms!SelectNam e![snLastName] & "'"
Me.Bookmark = Me.RecordsetClo ne.Bookmark

Am I just missing something small or is this not possible?

Thanks for any help.


Nov 13 '05 #7
I just checked a bit deeper and found that the displayed record was
still the first record but in the "Navigation Button" area the record
number was the correct number for the record that should be displayed.
I tried a requery before the Me.recordsetClo ne" code and it is now
working.

Thank you all for your help!! ;-)
On Tue, 11 Jan 2005 03:03:18 -0500, ShyGuy <sh****@shytown .com> wrote:
I have a form with a combo box for last name. It shows the record
with whatever name I select in the combo box. I am trying to get the
same results with code when I open the form by using a value from
another form.

I tried

Me.RecordsetClo ne.FindFirst "[LastName] = '" &
Forms!SelectNa me![snLastName] & "'"
Me.Bookmark = Me.RecordsetClo ne.Bookmark

Am I just missing something small or is this not possible?

Thanks for any help.


Nov 13 '05 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
1269
by: techy techno | last post by:
hii i created a form like this <html> <head> <title>ACCOUNT EXAMPLE</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> </head> <body bgcolor="#FFFFFF" text="#000000">
1
1479
by: Asha | last post by:
greetings, can someone show me how to read a client side value from code behind withouth having to resfresh the page? here is the code i've implemented.... btnSubmission.Attributes.Add("onclick", "return confirm('" & cboVal.SelectedItem.Value & "');") cboval.selecteditem.value will read the value when it was 1st loaded. i want it to dynamiclly read it? without refreshing it of cause. thanks in advance for your help.
2
1974
by: Steven K | last post by:
Hello, I am trying to learn how to use Code Behind. Essentially, the example of Block 1 and Block 2 are the same. The difference is that in Block 1 I explicitly set the parameter value to "menu_help". When I open the menu.aspx page and Call LoadMenu(), the value from the variable "strMenu" will populate the html table. However, with Block 2, I am sending the value "menu_help" using Call LoadMenu("menu_help"). When I use the statement...
3
6167
by: David | last post by:
Hi If I change the checked value of the checkbox by code, I can not trigger the CheckedChanged event of a checkbox control. Is there any way to implement it? Thank you very much!
2
7702
by: ambersaria420 | last post by:
I need to prompt the user to enter ID. I can open up prompt fine using javascript code below. However I am not sure how to get value that user entered in user prompt window. I have to check this value to see if it exists in the database. Private Sub btnID_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnID.Click Dim strPop As String strPop = "<script language='javascript'>" & vbCrLf & "var temp =...
13
1702
by: Kirk McDonald | last post by:
Say I have a database containing chunks of Python code. I already have a way to easily load, edit, and save them. What is slightly baffling to me is how I can effectively pass this code some arguments, run it, and somehow get a return value. (Acutally, in the process of writing this post, I figured out a pretty good way of doing it. Here's the rest of my post and the solution I came up with. Enjoy my thought process!) Right now I'm...
2
3387
by: duancg | last post by:
Hi, I wonder if someone could help since I wasn't able to find the answer through search. I have a simple .aspx page that shows data from a database table, as a table in UI. Now the data uses 1~12 to represent months, but I want to show them as Jan/.../Dec. So I thought I could write a simple function to convert it and call that function in the Bind expression of DataList. However, I just couldn't find a way to pass the bind...
12
1728
by: azalea45 | last post by:
Hi all I am a newbie when it comes to access. My company requires that all Databases run on the company SQL back-end as a result i have a Access project that connects to the server. I have two tables, table 1 called tblProjectDetails, table 2 called tblLearners The fields in tblProjectDetails are ProjectPK numeric (Its also the Primary Key)] Name char (50) Description char (50) There are other field but they dont play a role in the...
3
1810
by: Stevestan | last post by:
I have a query that prompts you to enter a value so that it can match that value with a table column. I currently use the symbols to do this. I would like to combine this function with the like funciton so that a user does not have to enter an exact match to get a result. I have tried using , **, and like , but those do not return like results. Any help is appreciated!
0
9647
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9489
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10356
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10162
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9959
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8988
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6744
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
4061
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2893
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.