Solved

reference label value on form in query grid function

Posted on 2013-01-25
4
343 Views
Last Modified: 2013-01-25
I have this:
Sequence7: Right(OnlyAlphaNum([vin_original_dvla])7)

how do i make the seven point to the value of a label on the form?

i tried:
Sequence7: Right(OnlyAlphaNum([vin_original_dvla]), me.LblExportSeqCount.caption)
am in the query grid in access 2010
0
Comment
Question by:PeterBaileyUk
  • 3
4 Comments
 
LVL 47

Expert Comment

by:Dale Fye (Access MVP)
ID: 38819589
Are you saying that the caption of the label has a numerical value that you want to use to determine how many characters to use?
0
 
LVL 47

Expert Comment

by:Dale Fye (Access MVP)
ID: 38819603
To refer to a control on a form, the syntax looks like:

Forms!formName.control

For a labels caption, you would also have to change that to a number, something like:

Val(Forms!formName.lblExportSeqcount.caption)
0
 
LVL 47

Accepted Solution

by:
Dale Fye (Access MVP) earned 500 total points
ID: 38820356
I assume that the OnlyAlphaNum( ) function call will return a string value

So, in your query it might look like:
Sequence7: Right(OnlyAlphaNum([vin_original_dvla]), Val(Forms!yourFormName.LblExportSeqCount.caption)))

Open in new window

0
 

Author Closing Comment

by:PeterBaileyUk
ID: 38821471
thank you fyed.
0

Featured Post

Backup Your Microsoft Windows Server®

Backup all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When you are entering numbers in a speadsheet, and don't remember what 6×7 is, you just type “=6*7" instead. It works in every cell! This is not so in Access. To enter the elusive 42 in a text box, you have to find a calculator, and then copy the re…
Regardless of which version on MS Access you are using, one of the harder data-entry forms to create is one where most data from previous entries needs to be appended to new records, especially when there are numerous fields and records involved.  W…
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…

929 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

6 Experts available now in Live!

Get 1:1 Help Now