Fixed Fields in Forms

DenizBerkel

Registered User.
Local time
Today, 19:38
Joined
Jun 27, 2013
Messages
19
Hi,

I've been creating a database. I prepared forms to enter records. In these forms there are many fields. I want some fields to stay fixed while going up to next record unless changed.
How can I do this?
Thank you...
 
You will need to write some VBA code to copy the data and place it in the new record.

Something like this:
Code:
Private Sub copyrecordbutton_Click()
On Error GoTo Err_copyrecordbutton_Click
Dim txtOld1 As Variant
Dim txtOld2 As Variant
Dim txtOld3 As Variant
Dim txtOld4 As Variant

txtOld1 = txtcurrent1.Value
txtOld2 = txtcurrent2.Value
txtOld3 = txtcurrent3.Value
txtOld4 = txtcurrent4.Value

RunCommand acCmdRecordsGoToNew

txtnew1.Value = txtOld1
txtnew2.Value = txtOld2
txtnew3.Value = txtOld3
txtnew4.Value = txtOld4

   
Exit_copyrecordbutton_Click:
    Exit Sub

Err_copyrecordbutton_Click:
    MsgBox Err.Description
    Resume Exit_copyrecordbutton_Click
    
End Sub
 
Thank you Alan.
Since I don't have any code knowledge that code you wrote is quite complicated to me.
Which parts of the code should stay fixed and which parts should I change to make it suit my database?
And where should I write this code?
Thank you very much...
 
out of interest, when you say you want some fields to remain fixed. why exactly would that be?

having "constant" fields may be indicative of issues with underlying database design.
 
thank you for your reply gemma. i attached my database to make it easier.
in the database when you open general data form funding stream and provider fields needed to be fixed unless changed.
i used after update event procedure code:
Private Sub Combo35_AfterUpdate()
Combo35.DefaultValue = Combo35
End Sub

Somebody had given me this code in this forum. it works for funding stream but not provider field. i can't sort it out why...

can you or any one else help me with this issue?

thank you very much...
 
Hopefully this time I could uploaded it correctly...
When you look at the GeneralData form there are two fields that I don't want them to be chanced for every record. Because the provider will be the same for maybe 10-15 records. So does the funding stream.

How can I keep them fixed unless they are changed by the user?

If I can't solve this issue I can't keep working on this project.
Thank you very much...
 

Attachments

Users who are viewing this thread

Back
Top Bottom