copy the info..allow editing

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am setting up a new membership database for my scout group. I have figured
out how to get the LastName (for the scout) to fill in the MomsLastName field
and the DadsLastName field. My issue is when the Mom or the Dad has a
different last name. If I make a change in either the MomsLastName field or
the DadsLastName field it changes the info in the other two fields. Any way
to get the info to copy over, then be able to edit it in the case when the
last names differ without it effect what I already entered? Ideally I would
love to have a check box that would allow

Thanks so much!
~NoRJDont
 
I am setting up a new membership database for my scout group. I have figured
out how to get the LastName (for the scout) to fill in the MomsLastName field
and the DadsLastName field. My issue is when the Mom or the Dad has a
different last name. If I make a change in either the MomsLastName field or
the DadsLastName field it changes the info in the other two fields. Any way
to get the info to copy over, then be able to edit it in the case when the
last names differ without it effect what I already entered? Ideally I would
love to have a check box that would allow

How did you have the scout's LastName propagate to the other LastName
fields? It sounds like you have only *one* table field for the
lastname, and that you're (erroneously) assuming that having separate
Form Textboxes will let you store three different names.

Forms are JUST windows onto the data in Tables. If you want three
names, you must have three fields in your Table - or, probably much
better, three *records* (one for each person).

What's the structure of your table?

John W. Vinson [MVP]
 
Not sure what you mean by structure...I'm very very new to this. But I do
have separate fields in my table for everyone. MomsLastName has its own filed
as does DadsLastName. How I got the info to copy over was by changing the
"control source" to LastName(the field for the scout). I saw that this was
creating a scenario like you described. My unfinished thought at the end what
something along the lines of a bill to/ship to scenario. Is Moms Last Name
same as child's? Check yes...billto/ship to are the same. Click no...enter
the correct name.

This is probably something way beyond my skill level in this matter, but I
figured I'd give it a shot.

Thanks for your reply!
~NoRJDont
 
Not sure what you mean by structure...I'm very very new to this. But I do
have separate fields in my table for everyone.

Probably not the best design, but let's leave that be for the
moment...
MomsLastName has its own filed
as does DadsLastName. How I got the info to copy over was by changing the
"control source" to LastName(the field for the scout). I saw that this was
creating a scenario like you described. My unfinished thought at the end what
something along the lines of a bill to/ship to scenario. Is Moms Last Name
same as child's? Check yes...billto/ship to are the same. Click no...enter
the correct name.

Well... setting the Control Source to LastName means that the *table*
fields MomsLastName and DadsLastName will neither be displayed nor
updated. Not what you want!

Instead, set the Control Source of the MomsLastName control on the
form to MomsLastName; and the Control Source of DadsLastName to
DadsLastName. I'd suggest changing the Name property of each textbox
so that it's different from the table fieldname - Access defaults to
have them the same, but this can be confusing. I'll assume you have
textboxes named txtLastName, txtMomsLastName and txtDadsLastName.

Select the txtLastName control; view its Properties; find the
AfterUpdate event on the Events tab and click the ... icon by it.
Select Code Builder. Access will give you a Sub and End Sub llne -
edit the code to

Private Sub txtLastName_AfterUpdate()
If IsNull(Me.txtMomsLastName) Then
Me.txtMomsLastName = Me.txtLastName
End If
If IsNull(Me.txtDadsLastName) Then
Me.txtDadsLastName = Me.txtLastName
End If
End Sub

This will fill in the two textboxes, but will not overwrite any
existing data.

John W. Vinson [MVP]
 

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

Back
Top