Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access VBA
|
Access VBA Discuss using VBA for Access programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access VBA section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old October 17th, 2003, 03:12 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,093
Thanks: 1
Thanked 12 Times in 11 Posts
Default

Actually don't treat DateID as optional. You'll find its the easiest way to a hold of lstDates.ItemData(lstDates.ListIndex). I'm using it as the bound column of the listbox.

Bob

 
Old October 17th, 2003, 03:55 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,093
Thanks: 1
Thanked 12 Times in 11 Posts
Default

Final thought. If you want to be able to add new divers through this form as well as new date data, you'll need to make sure that the diver record (DiverID, FirstName, LastName) is saved before attempting to enter date information for that diver. An easy way to do that would be to add a 'Save' button to your form, and place this behind it:

Private Sub cmdSave_Click()
    DoCmd.RunCommand acCmdSaveRecord
End Sub

The diver record has to exist in tblNewDivers before you can use the cmdAddDate button to start adding dates to tblDates.

Bob

 
Old October 17th, 2003, 04:08 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 196
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
quote:If you want to be able to add new divers through this form as well as new date data, you'll need to make sure that the diver record (DiverID, FirstName, LastName) is saved before attempting to enter date information for that diver.
One thing that I have done in some applications is to hide the tblDates subform whenever I add a new record to tblNewDiver via frmDivers. Clicking on the Save button can also un-hide the subform.

This eliminates the possibility of accidental orphan records in the tblDates table.

Rand
 
Old October 20th, 2003, 05:44 AM
Authorized User
 
Join Date: Jul 2003
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Default

HI Bob and rgerald,

right first things first thanx for all your help, but im having a problem with the new set of code, ive actually changed my db to work around the new tbl names and fields but am having no luck first i get a debug problem then redone it again and now get a parameter prob.

Just a quick note, in tblnewdiver diver i do have more than 3 fields(in orginal version) you have just methioned DiverID, Firstname and Lastname, or do the other fields just not applicable when writing to the table...?(another 12 fields)

Ok what ive done is uploaded the db(256k Zipped) to my website, this version of the db has been developed around the code you have given me(well most of it).
could you possible have a look at it and tell me where ive gone wrong or email me the correct version of how its suppose to work(email address on website)
www.whathappenedwhen.co.uk/access/version1.htm
ive uploaded a copy of the orginal db(with the first set of code you gave me as well)

thanx guys!


P.s is their anyway of changing what the msgbox says when deleting a record, it says "Do you want to delete record 0" could it say "Do you want to delete record 12/12/03" or what ever date they select to delete?





Similar Threads
Thread Thread Starter Forum Replies Last Post
job for experts g_tufat Need help with your homework? 0 July 3rd, 2006 05:49 PM
Experts?? Problem w/ Webrequest MAtkins ASP.NET 1.0 and 1.1 Professional 2 April 9th, 2006 10:21 PM
Any xlink experts out there? mountainbiker XML 3 February 29th, 2004 01:49 PM
Any File (input #1) experts help? enterbase Access VBA 2 February 2nd, 2004 08:35 AM
Help, any javascript experts! tanmaylian Javascript 1 January 21st, 2004 04:59 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.