Auto Filling fields in form

B

Bev

I am new at creating code and would like to have two fields populated when
the record is reviewed.

One is the user name and the other is the date reviewed.

There is a form which contains the Member Name and ID number. I would like
to add the two auto fill fields in the Parent form and have it fill in the
subform fields for that particular member using a trigger of some sort.

Any advice would be appreciated.
 
J

Jeff Boyce

Bev

Access forms display data... Access tables store it.

If you want to see data from a record in a table in your form, your controls
in the form need to be pointed at the underlying fields. Are they?

(NOTE: yes, I know, it's possible to use unbound forms, but in a simple
Access database/application, there's no need to take on the extra work)

Regards

Jeff Boyce
Microsoft Access MVP

--
Disclaimer: This author may have received products and services mentioned
in this post. Mention and/or description of a product or service herein
does not constitute endorsement thereof.

Any code or pseudocode included in this post is offered "as is", with no
guarantee as to suitability.

You can thank the FTC of the USA for making this disclaimer
possible/necessary.
 
B

Bev

Actually, the underlying table does not contain data in these fields. I am
using the form as a mechanism to populate these fields in the table. In the
review process, many records are reviewed at one time. Each record need to
have two fields always populated, the review and the date (current date). I
am hoping to find a way thru the Parent form which reads the same table but
only shows records for one member at time. The subform contains all of the
specific claim data and review results.

Does that explain?
 
J

Jeff Boyce

I guess I'm still not visualizing your data structure...

It sounds like you're saying that you DO have the data, but it just isn't
stored where you want it to be.

But if you already have the data stored in one place, why do you believe you
need to store it in another?

More info, please...

Regards

Jeff Boyce
Microsoft Access MVP

--
Disclaimer: This author may have received products and services mentioned
in this post. Mention and/or description of a product or service herein
does not constitute endorsement thereof.

Any code or pseudocode included in this post is offered "as is", with no
guarantee as to suitability.

You can thank the FTC of the USA for making this disclaimer
possible/necessary.
 
B

Bev

I have data records that contain data to be reviewed. There are additional
fields in the table which allow for entry of additional comments, member
input, review and date. The reviewer fills in the blank fields that populate
the table.

My hope is that as the reviewer is evaluating the many records for each
patient, we can auto populate the Review name and review date for all records
for that member in one entry after all other fields have been completed.
 
J

Jeff Boyce

That makes sense.

What I'm not clear on is why you seem to be trying to copy information from
one table to another?

Regards

Jeff Boyce
Microsoft Access MVP

--
Disclaimer: This author may have received products and services mentioned
in this post. Mention and/or description of a product or service herein
does not constitute endorsement thereof.

Any code or pseudocode included in this post is offered "as is", with no
guarantee as to suitability.

You can thank the FTC of the USA for making this disclaimer
possible/necessary.
 
B

Barry A&P

I am new to this so please excuse my Gross syntax...

Maybe on the record to be reviewed if you have a textbox like "reviewedby"
bound to the "reviewedby" field in the records table same with
"DateReviewed"
put a unbound textbox on your main form with something like "ReviewerNametxt"

you could use something like this on your subform

Private Sub reviewedBy_DblClick(Cancel As Integer)
Me!reviewedBy = Forms![parentformname].ReviewerNametxt
Me!dateReviewed = Now
End Sub

then when the reviewed record's reviewedby box is double clicked the data
will be added..

of course you might want to do some checks for a null reviewedby text but
thats another subject

hope this helps
Barry
 
B

Barry A&P

If you want to autofill "ALL" of the records on the subform you can write a
update query something like this..

private sub Button_onMainForm_Click()
DoCmd.RunSQL _
("UPDATE tblrecords " & _
"SET tblrecords.reviewedBy = [Forms]![F_customers]![ReviewerName],
" &_ "tblrecords.dateReviewed = Now() " & _
"WHERE (((tblrecords.whateverfield)="whatever"));
end sub

the WHERE statement is important because the query must be able to select
the same records for update as your subform is displaying..

Now PLEASE BE CAREFULL WITH UPDATE QUERIES""" AND BACKUP YOUR DATA

Barry A&P said:
I am new to this so please excuse my Gross syntax...

Maybe on the record to be reviewed if you have a textbox like "reviewedby"
bound to the "reviewedby" field in the records table same with
"DateReviewed"
put a unbound textbox on your main form with something like "ReviewerNametxt"

you could use something like this on your subform

Private Sub reviewedBy_DblClick(Cancel As Integer)
Me!reviewedBy = Forms![parentformname].ReviewerNametxt
Me!dateReviewed = Now
End Sub

then when the reviewed record's reviewedby box is double clicked the data
will be added..

of course you might want to do some checks for a null reviewedby text but
thats another subject

hope this helps
Barry

Jeff Boyce said:
That makes sense.

What I'm not clear on is why you seem to be trying to copy information from
one table to another?

Regards

Jeff Boyce
Microsoft Access MVP

--
Disclaimer: This author may have received products and services mentioned
in this post. Mention and/or description of a product or service herein
does not constitute endorsement thereof.

Any code or pseudocode included in this post is offered "as is", with no
guarantee as to suitability.

You can thank the FTC of the USA for making this disclaimer
possible/necessary.




.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top