Hi All;
I have a form that contains a textbox control called CPUServicetag (Serial number). My users enter in the CPUServicetag manually. My question is this ... How do I go about creating an expression in a separate textbox control with in the control source that would cross reference the manually entered CPUServicetag to a Table called RMA which contains two fields: Serial_num (CPUServicetag) and RMA# , and display in this separate textbox control the RMA# associated to the CPUServicetag which is the same as Serial_num. This is something I have never dealt with before and need some assistance
16 3211 NeoPa 32,579
Recognized Expert Moderator MVP
You can use the DLookup() function. Give me a short while and I'll knock up some (non-specific) VBA code to put in your form. If you were to come back with the correct name of the controls on your form where the data will be shown and the types of the two fields used, then I could tailor it more precisely.
NB. Access doesn't like using a '#' char in a control name - it will be converted automatically in related event names.
NeoPa 32,579
Recognized Expert Moderator MVP
Hi All;
I have a form that contains a textbox control called CPUServicetag (Serial number). My users enter in the CPUServicetag manually. My question is this ... How do I go about creating an expression in a separate textbox control with in the control source that would cross reference the manually entered CPUServicetag to a Table called RMA which contains two fields: Serial_num (CPUServicetag) and RMA# , and display in this separate textbox control the RMA# associated to the CPUServicetag which is the same as Serial_num. This is something I have never dealt with before and need some assistance
I've assumed you will change your [RMA#] field name to simply [RMA], and, for now, have assumed that the Serial_num field is alpha-numeric. - Private Sub CPUServicetag_AfterUpdate()
-
Dim strRMA As String
-
-
If Me!CPUServicetag > "" Then
-
strRMA = "='" & DLookup("RMA", "RMA", _
-
"Serial_num='" & Me!CPUServicetag & "'") & "'"
-
Else
-
strRMA = ""
-
End If
-
Me!RMA.ControlSource = strRMA
-
End Sub
Thank You!! ... Thank You!! ... Thank You!! .... This resolved my issue.....Also I took your advice and changed my column name from RMA# to RMA
NeoPa 32,579
Recognized Expert Moderator MVP
If I wanted to pass the varRMA to a text box field"RMA" in my table"MonitorRe turn" : ? ? ? Would this be the correct method ? - varRma = "RMA", "MonitorReturn"
NeoPa 32,579
Recognized Expert Moderator MVP
I'm afraid not.
I get that you have a table=[MonitorReturn], but tables don't have TextBox fields. Are you talking about a form perhaps? And which way are you moving the data - your example looks as if you want to set varRMS (a VBA variable) from somewhere else rather move its value into your TextBox.
I want to pass the RMA number that I was able to ascertain from the code we discussed earlier in this thread and deposit the RMA number in to a RMA column in the table MonitorReturn. I can make the RMA number appear in my Form Text Box "RMA" now I want to record it in my table.
NeoPa 32,579
Recognized Expert Moderator MVP
Sorry, I just read the last post quickly. I was rushing to catch up with all the updated threads since my last visit.
What you need is for the control (RMA) on your form to be bound to the underlying table. I assume the form is bound to the MonitorReturn table?
Yes you are correct sir ! The Form is bound to the table ... I need the RMA result to deposit the RMA result into the table in a column(RMA) in Table (MonitorReturn)
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: Bhavin |
last post by:
Anybody quickly replies it, would be a great help!
I try to create dynamic array of textboxes control in ASP.NET(C#). I got the
following error while I tried to assign value to ID property of dynamically
created textbox. (look at my code please )
Error: “ Object reference is not set to an instance of Object”
totalRows – int variable which varies with number of records in SQL table
|
by: Max |
last post by:
Suppose we have an object hierarchy in XSD.
For example, let us take Control, Label, TextBox and LinkLabel windows
controls.
Each control has some properties which are represented as elements.
Some of the elements are of complex types as well, like bounds - of type
rectangle.
(See full example in the bottom of the letter.)
DataSet.ReadXMLSchema fails to parse such XSD file.
The problem is caused by complex type as an element of the...
|
by: Omar Llanos |
last post by:
I have Form1 and Form2 (which is inherited from Form1), and I created a
button in Form2 that will fill up a textbox in Form1. What code would do
that?
I tried the simplest way:
//from child form in button2 clicked event:
textbox1.Text = "Hello";
|
by: Andy |
last post by:
I am attempting to print out a table using a repeater in which one field is
updatable. Basically you would have a table of x number of rows and y number
of columns. However: only one field in each row will be updatable. My
thought was to build a repeater and then one of the <ItemTemplate> would be a
textbox where the user can update the values in each.
How would I go about in the code-behind to reference each textbox? My
texbox...
|
by: John Mason |
last post by:
Hi,
I am trying to work out how to make reference to an asp textbox control
within a class, contained in a user control, but receive the following
error...
BC30469: Reference to a non-shared member requires an object reference.
Here is the code...
| |
by: Mats Lycken |
last post by:
Hi,
I'm creating a CMS that I would like to be plug-in based with different
plugins handling different kinds of content.
What I really want is to be able to load/unload plugins on the fly
without restarting the application.
What I did was to create an AppDomain that loaded the plugins and
everything was great, until I tried to pass something else that strings
between the domains...
|
by: Motoma |
last post by:
This article is cross posted from my personal blog. You can find the original article, in all its splendor, at http://motomastyle.com/creating-a-mysql-data-abstraction-layer-in-php/.
Introduction:
The goal of this tutorial is to design a Data Abstraction Layer (DAL) in PHP, that will allow us to ignore the intricacies of MySQL and focus our attention on our Application Layer and Business Logic. Hopefully, by the end of this guide, you will...
|
by: james.beauchamp |
last post by:
Hi
I'm trying to create a control with multiple regions that can be
edited - maybe as templates I guess.
I've seen a control that was done by Scott Mitchell which has rounded
corners surrounding the control - here is a link to the page
http://aspnet.4guysfromrolla.com/articles/081104-1.aspx) and this
essentially has one editable region that will then be surrounded by
the borders.
|
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, well explore What is ONU, What Is Router, ONU & Routers main usage, and What is the difference between ONU and Router. Lets take a closer look !
Part I. Meaning of...
|
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,...
|
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...
| |
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
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 presenter, Adolph Dupr who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
|
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...
| |