Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Access 97 Subform Data Entry issues

Status
Not open for further replies.

JKDeveloper0718

Programmer
Aug 11, 2006
23
US
I have a subform inside my main form that is populated from table with the record source as follows

SELECT tblMember.* FROM tblMember WHERE (((tblMember.ApplicationId)=ApplID)) ORDER BY tblMember.MemberNumber;

the problem I have is it populates the information fine for each record in the main and a person may have more than one member in this subform but I cannot add new records from the subform.

I have turned the Data Entry feature to True and the form is in datasheet view looking like a table. When I have changed the Data Entry attribute to true the record set goes blank for each applicants subform info.

Any suggestion on Data Entry from the subform that will still allow it to have the previous records displayed would be nice. Below is look at the subform

Member# Last Name First Name MI BirthDate ....
01 Kress James N 07/18/1987
02 Fress John W 08/15/2000
--New Entry Here --- - ----


 
Hi JKDeveloper0718,

1. Leave DataEntry set to 'no'
2. Check if you subform is updatable. You can check this by selecting the recordsource of the subform (...), open the query designer and run the query (datasheetview). If the recordnavigators add_record icon (>*) is transparant, it means your recordset is not updatable.

3. If your subform is not updatable, make it updatable. How? Take a look at Harnessing the Power of Updatable Queries, at:


Pampers [afro]
Keeping it simple can be very difficult
 
How are ya JKDeveloper0718 . . .

I have an immediate problem with the SQL you gave:
Code:
[blue]SELECT tblMember.* FROM tblMember WHERE (((tblMember.ApplicationId)=[purple][b]ApplID[/b][/purple])) ORDER BY tblMember.MemberNumber;[/blue]
What is the source for [purple]ApplID[/purple]? . . . surely not the same query?

I'm beliving it should be:
Code:
[blue]SELECT tblMember.* FROM tblMember WHERE (((tblMember.ApplicationId)=[purple][b]Forms!MainFormName!ApplID[/b][/purple])) ORDER BY tblMember.MemberNumber;[/blue]
The above is also indicititve of the subform not being linked by [blue]Master/Child link[/blue] properties . . . is this correct?

[blue]Your Thoughts? . . .[/blue]

Calvin.gif
See Ya! . . . . . .
 
Actually that was not the proper filter variable it was -1 believe it or not but the subform was filtering to tblmember by the applicationid. What the problem is I believe the master and child field is not linked properly and in the subform itself the applicationid is not there which is the primary and foreign key.

In the VBA is where the connetion is but I commented out the vba and added in the record source of the subform like the following to test:

SELECT tblMember.* FROM tblMember WHERE (((tblMember.ApplicationId)=1652)) ORDER BY tblMember.MemberNumber;

this gave me specific applicant member information but as I added the Data Entry attribute set to true it no longer showed the member info just a blank record set for entry which is not what I want.

My gut feeling is that I need to set all fields in the record Source select statement as such

SELECT tblMember.ApplicationId, tblMember.Name ...
FROM tblMember WHERE (((tblMember.ApplicationId)=1652)) ORDER BY tblMember.MemberNumber;

But with this make sure that all the fields from that table are in the subform this will make it updateable

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top