View Full Version : tables and forms
funnynutso
02-04-2006, 10:13 PM
I have a ms access 2003 database.
Im trying to fiqure out have to code something for the following:
I have 5 forms, all have corresponding tables. the main form I call form1 has 4 buttons each going to the other different forms (form2, form3 so on). each form has the same 2 fields "Date" and "Address". When I type the date and address into the fields on the first form, Id like to go to the other forms via command buttons and see the same thing their.
Is this possible and if so How?
thanks for your time.:confused:
smeagol
02-05-2006, 06:18 AM
Consider making a public function/sub in your forms that allow you to set the values of the textboxes, and then set them when click the buttons.
funnynutso
02-05-2006, 05:37 PM
would it look something like this
Public Sub Table2Address_BeforeUpdate(Cancel As Integer)
'in here? "Address" = form1.Address.value
'and what about "Date" = form1.Date.Value
End Sub
smeagol
02-06-2006, 02:28 PM
I was thinking something like this:
Public Sub SetAddressValue(strAddress As String)
Me.Address.Text = strAddress
End Sub
You could do the same for the Date field. Then you could call these subs when you click your button, and thus set the values for these fields.
funnynutso
02-06-2006, 09:27 PM
Thanks for the help.
I couldnt get it to work for me. Its probably just me.
What I did was to copy three items from the main table;
UnitId, Address and Date and created 7 different forms, then I just used different subforms on each new form.
Does that make sense?
If so then the records from the original table;
UnitId, Address and Date would pop up everytime I clicked a button for each form. they would be at the top of the form, all the info from the other tables would be in the subform and all would be well right?
Well not so says funnynutso:
When I click a button to go to another form the only thing that pops right up is the date (which I made a default with Date()). the other is the UnitID after I start typing something. The Address doesnt come up?
I could show you the Private subs, but it isnt anything abnormal. All has been created with access wizards.
I saw your Public code,
but when I put it in, its like it doesnt see it or something
what do ya think?
Anything more would be great.:eek:
funnynutso
02-07-2006, 02:05 AM
:) Ive tried a number of things all seem to be wrong.
this is what Ive got :
vBulletin® v3.8.2, Copyright ©2000-2012, Jelsoft Enterprises Ltd.