Enter identical data in next record (1 Viewer)

wdrspens

Registered User.
Local time
Today, 16:33
Joined
Jun 19, 2008
Messages
63
I use a form to enter new data into a room booking database for the hire of rooms in a hall for events, and for a large part of my entries I have no problems because the entries are stand alone. The problem arises when a customer wishes to book repeat dates, usually not consecutive, but often on, say, the second Tuesday of each month, or on every Thursday of each month.
For that customer all the entries in the various fields on the form are identical except the date field. Now I can use "copy and paste" for the whole record and just change the entry in the date field, but that is not professional and is not always easy to teach to another person entering the data.
What I would like is to enter the data for all the fields for the first date record, and then when I move to the second record to have all the data (except the date) automatically populated by the data in the first record, so that all I now have to do is enter the new date.
How do I achieve this, if possible without programming in vba as I am not very proficient in that language.
Many thanks,
David
 

JamesMcS

Keyboard-Chair Interface
Local time
Today, 16:33
Joined
Sep 7, 2009
Messages
1,819
Have you considered having a subform for the booking data, and customer data on the main form?
 

wdrspens

Registered User.
Local time
Today, 16:33
Joined
Jun 19, 2008
Messages
63
Yes I have, but the other data is not always completely identical, the times in or out might change, the date payment is made might change etc. so rejected that idea, but could certainly reconsider it. I am thinking about redesigning the database in any event, if I cannot find a neat answer to the problem posed.
Thanks for the suggestion.
 

JamesMcS

Keyboard-Chair Interface
Local time
Today, 16:33
Joined
Sep 7, 2009
Messages
1,819
Cool OK - I'm sure there's a better way of doing it, but first thought would be to have a "Create new booking for this customer" button, whose code takes the data you want, stores it in variables, moves to a new record and puts the values back in the relevant text boxes.
 

wdrspens

Registered User.
Local time
Today, 16:33
Joined
Jun 19, 2008
Messages
63
Thanks, I am sure that would do what I want, but I am not yet sufficiently experienced to write that sort of code.
 

JamesMcS

Keyboard-Chair Interface
Local time
Today, 16:33
Joined
Sep 7, 2009
Messages
1,819
OK. So create a new button. In the on click code, put
Code:
Dim value1 as datatype, value 2 as datatype...
 
Value1=Field1
Value2=Field2
...
 
docmd.gotorecord ,,acnewrec
 
Field1=Value1
Field2=Value2
...
Obviously substituting value1... as memorable names for your variables, the correct data type for datatype, and the correct field names for field1...
 

JamesMcS

Keyboard-Chair Interface
Local time
Today, 16:33
Joined
Sep 7, 2009
Messages
1,819
No worries fella, let me know if you come up with any problems...!
 

wdrspens

Registered User.
Local time
Today, 16:33
Joined
Jun 19, 2008
Messages
63
I have tried your suggestion, which is tough as there are some 47 fields involved, but have come across many instances of my ignorance.
1. I have the following data fields:
Text
Date/Time
Number
Currency
Yes/No
Memo
What is the corerct data type for each of those data fields?
2. How do I enter the script into the on click code? Should I use "Macro Buider", "Expression Builder" or "Code Builder"?

In my pathetic attempts to enter the code I have used "Code Builder" and found the data types above did not exist, although there was "Textbox" and "Checkbox" for, presumably "Text" and "Yes/No", but it still did not work too well.

Could you clear my fog please.

Regards
David
 

Users who are viewing this thread

Top Bottom