Cannot read from forms

khurram7x

Registered User.
Local time
Today, 05:15
Joined
Mar 4, 2015
Messages
226
In Access 2010, Under what conditions can we read values from forms please??

I'm trying to write query in which i want to find and update records based on saved record, but seems like Access is not reading values. I've opened the form and add a button to run a query, so the form is for sure in focus.
On the other hand, when I try to read values from form based on new record, a record which is not yet saved, Access is reading values without any problem. What could be the issue please??

Thanks.
 
You are confusing me.

You can read a new record but not an old one is that correct?
 
You are confusing me.

You can read a new record but not an old one is that correct?

I meant to say, I can read the values from Form Controls only for the new record while I'm entering data. But once I fill-in all the fields and save the record, after that I can't read it from Form Controls anymore.

I need this for comparison with other tables/records. for e.g. Access can use value from [Forms]![frmEmployee]![LastName] for comparison before I save the record and i can use it in Before Insert or After Insert event, but I get nothing from [Forms]![frmEmployee]![LastName] for comparison once record is saved.

Have I got any success in clearing things up please?
 
Last edited:
Where/in which form do you use the above reference?
Attaching file. Trying to select from the master form, one on top.
Thanks.
 

Attachments

  • Forms.JPG
    Forms.JPG
    37.3 KB · Views: 102
Hmm - it is only a picture from a form, nothing to select here.:confused:
 
Hmm - it is only a picture from a form, nothing to select here.:confused:
I sent an screenshot of a form, obviously it'll not work )
Ok, i'm attaching the Access file here. Nothing secret, so I can share the file.

you'll see in form named as 'frmEmployee', there's a button with 'Update Query' icon. I just put it temporary to run the query. it is running 'qryOldEnrollment1' which show me information about people from other tables about the record which is open in the form. But it is showing me info about all, because it is not filtering results.

Please use last 2 3 records when you give it a try, because it has some info. in child tables as well.

BTW: don't pay attention on over design of the attached database as I'm new to databases. I know it is a very bad design and already working on other versions of the same program, but want to get this sorted please.

Thanks.
 
Last edited by a moderator:
You can read the Current Record and controls that are not bound to the recordset. You cannot read the other records until they are Current.

If you want to process data held in all the records on the form you probably should use a query that incorporates the data that is the basis of the form's recordset.
 
You can read the Current Record and controls that are not bound to the recordset.

Thanks Galaxiom, if by current you mean the record which is currently open on my screen, then I'm trying to read from the current record but it is not working. I should be able to use the value in controls of the current record as per my information about Access so far, but it is not happening.

[/QUOTE]... process data held in all the records on the form you probably should use a query that incorporates the data that is the basis of the form's recordset.[/QUOTE]

I'm not clear here. I'm only looking to get the values of current record opened in the form so that I could use it as a criteria for a query.

Thanks.
 
You have a Filter.

([tblEmployee].[Project]=482)

I think you need to get rid of that.

I can't read much of 2010 as I run 2003 and 2007. I am limited.

Give this a try but do a back up first.
 
Open your properties box. Make sure the Form has the focus.

Look under the All Tab.
 
Look under the All Tab.

Thanks, but it is still not working.
I'm confused why it is still not reading from form on focus. if I enter values manually, it gives the correct result, attaching screenshot. This is record # 29 in attached database above, but when I try to read from form it simple doesn't work and show all records in tblEmp_C_Training table.
This is the only thing left in the completion of my small project (
 

Attachments

  • Manual.JPG
    Manual.JPG
    28.4 KB · Views: 84
Is this what you want to get?


If yes, you need to set the references to the form (and not to the table as you've done, change it to the below):
[Forms]![frmEmployee]![Project]
[Forms]![frmEmployee]![JobTitle]
 
Last edited by a moderator:
I can't make head nor tails with this.

Is it possible to post a cut down version of what you have.

Convert to the oldest version that you can. Like 2003 or 2007.

What do you actually mean by "Read". This could mean more than one thing.
 
If yes, you need to set the references to the form (and not to the table as you've done, change it to the below):

Thank you JHB, for pointing out my mistake... I thought tables will be fine to refer because anyways the pointer is on the current record set!! It works perfect now.

Just a request, please remove the pasted image from your post. Access file was ok, but this is way too open. Thanks in advance )

... What do you actually mean by "Read". This could mean more than one thing.

Thanks for your support RainLover, got it working now.
 

Users who are viewing this thread

Back
Top Bottom