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

Access - Get subForm datasheet value of row

I have a subform which is created with textbox and some command button in the top of the window, so this will simulate like a Datagrid.

http://imgur.com/MpIpksT

This is how it looks my datagrid when it fills from a Query.

http://imgur.com/kxAS8Ff

What I want is when I select a row from my subform, I want to Click the button "Cambiar", and get the value of the machine selected.

http://imgur.com/LCEQlSI
Feb 27 '15 #1

✓ answered by Oflores23

@Oflores23
Solution:

http //imgur.com/gikNKPc

I just write:

Referred from:
http //access.mvps.org/access/forms/frm0031.htm

MsgBox Me!zfrmStatus.Form!txt_machine_name.Value

and it brings the value from the selected row.

Thanks for the HelP!

3 4740
twinnyfo
3,653 Expert Mod 2GB
When posting images, please use the Advanced button, as many of us can't view image server sites at work.

What do you mean that you want to "get the value of the machine selected"? What do you want to do with that value?

You may be able to make a direct reference:

Expand|Select|Wrap|Line Numbers
  1. Me.zfrmStatus.Machine_Name
but that may likely refer to the first record in the subform, since your focus has moved to the Main Form.

Depending on what the "Cambiar" button does, you may want to switch the subform to a Continuous Form (instead of datasheet). This allows you numerous advantages.

First, you can resize and arrange columns more easily. Second, you can add a button in the detail section of the subform (Cambiar) and when you click on the button associated with that record, you can refer directly to that particular record:

Expand|Select|Wrap|Line Numbers
  1. Me.Machine_Name
Again, it depends on how you want to use that value.
Feb 27 '15 #2
@twinnyfo
Isn't a Continous Form that Form? sorry i'm just newb at this, they are only 1 text box so it appears at many rows depends on my query.

OK, I just tried to get the single value of a column depending on the row I select, this is because I want to change the value in another form. But to express that idea its a little bit more difficult, that's what I only want to get the value, even juts to show in a Msgbox.

For example if select row 2, I want to get the value of the machine_name "ATO 02", but that in case I had filted "Operacion", maybe I filter in other thing, and now row 2 its "MINI 02" so how I can get the value not of the row, but the column or the textbox of that.
Feb 27 '15 #3
@Oflores23
Solution:

http //imgur.com/gikNKPc

I just write:

Referred from:
http //access.mvps.org/access/forms/frm0031.htm

MsgBox Me!zfrmStatus.Form!txt_machine_name.Value

and it brings the value from the selected row.

Thanks for the HelP!
Feb 27 '15 #4

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

Similar topics

1
by: edself | last post by:
I have a form which displays a subform datasheet of information. I'd like to be able to quickly click on a particular record and open up another form showing more detailed information about that...
3
by: deko | last post by:
I have a form with a subform datasheet - I need code behind the OnDelete event of the subform: Private Sub Form_Delete(Cancel As Integer) 'do something that depends on which record is deleted...
4
by: jenn | last post by:
Hi Anyone knows how to access to a value of a row in a datalist. Something like this in datagrid Dim str = MyDataGrid.Cell(0).tex I would like something like this Dim str =...
11
by: cooperkuo | last post by:
Dear all, I have a question about ADO in the subform. I know how to use ADO to insert/update/select data into the sigin form, but wehn I try to do it in the form with subform((Datasheet). I don't...
0
by: clarkp73 | last post by:
Hi In VBA I populate an unbound subform (datasheet view) via a recordset that can be changed using filters selected by the user. The only problem I am having is that due to the unbound nature of...
0
by: Gordon Padwick | last post by:
A form contains controls, one or more of which can be other forms. A form that contains another form is known as a main form. A form contained by a main form is known as a subform. A subform itself...
2
by: ritesh272004 | last post by:
Hi, On the basis of Keys pressed i wanted to prepare a dynamic menu form the existing records. Hence wanted to understand if Keyup/KeyDown/KeyPress events are available in Access SubForm. ...
2
by: Suzie Harmon | last post by:
HI, Is there a way to force the left/right position of a horizontal scroll bar on a subform datasheet? I.e. Position the scroll bar to be mid-way centered on the form between the left and right...
3
by: ramoj | last post by:
Hi All, I am new to this Forum. Good Day All, I'm having a problem with the syntax of a recordset of a Datasheet inside a subform which is also inside a Main Form. Main Form - frm_1_0_LMS...
1
by: tetsuo2030 | last post by:
greetings. I have a form with a subform set to datasheet view, but i'm running out of real estate, so I just want to shrink the font. I've scoured boards and nothing seems to be working. I've...
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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...
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...

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.