Click here to Skip to main content
15,891,372 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have a form that has a calendar so you can choose the date and labels along the side for the time. When you choose the date it appears in a seperate label and then when you click a time it opens up Form2 to record extra details of the appointment. It also colours in the time labels back colour so you know an appointment has been made for that time. However i cannot work out how to save this information so that whenever i close Form2 the appointment is not forgotten. When i open it again from the start the time labels for the date that i made the appointment on should still be coloured in and if i click on one of them the details of the appointment should be visible.

Any ideas on what i need to do

Thanks Tiarnan
Posted

1 solution

Sounds like you need to look at persistent storage - in this case I would suggest a database would be a suitable storage medium.
Which one will depend on you, and what your environment is like. If this is intended as a stand-alone, single user application, then look at SqLite or SqlCE - either will work pretty well and be small footprint.

You could do it yourself with either a text file, or in XML, but then you would have to process them yourself - a DB is probably a better solution.
 
Share this answer
 
Comments
Member 9308609 26-Jul-12 4:28am    
The form is for service appointments for machines and i already have a db of all the machines stored in access would that do
OriginalGriff 26-Jul-12 4:35am    
Yes - perfectly.
Just add another table that contains the appointment details and links it to the machine (if needed) and you are away.
You may want to add some routine maintenance features that archive or delete past appointments, but that will depend on how many you are expecting. If it's one app per week, then it probably isn't worth the trouble. If you are booking exercise equipment in thirty minute slots (say) then it would be a good idea, to prevent the DB growing too large.
Member 9308609 26-Jul-12 4:40am    
sorry to ask for this but i relly dont know how to do this. Could you pastesome code for how to read and write to this db. Also how does it work if i have several fields in my form
OriginalGriff 26-Jul-12 4:47am    
Add another table is easy - you just use either Access or SSMS as you would normally: whichever you used to create the DB in the first place.
And the code is the same as the code you are using to access the database at the moment - just with an INSERT statement that refers to the new table and values.

I can't give you code - I have no idea how your system works at present! :laugh:
Member 9308609 26-Jul-12 4:50am    
cheers

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900