William Benson
vbacreations at gmail.com
Sun Oct 23 22:41:05 CDT 2011
Yes to pk, it is simply [Id] Userid is indexed, required, no dupes allowed. I cant remember if i used dlookup ("[userid]='" & txtuserid &"'") or an inline SQL to check if txtuserid is already in the table or not. This for is working perfectly but I had a question about current not being fired after using bookmark On Oct 23, 2011 11:24 PM, "Rocky Smolin" <rockysmolin at bchacc.com> wrote: > Are you using an autonumber PK? Any other fields indexed-no duplicates? > > How will you determine if the info is already in the table? What fields? > Will those fields still be empty at the time of the Before Insert event? > > Rocky > > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of William Benson > (VBACreations.Com) > Sent: Sunday, October 23, 2011 7:17 PM > To: 'Access Developers discussion and problem solving' > Subject: [AccessD] AddNewRecord "Problem" > > Accdb database, I am not too familiar with Ac2010. > > ... especially how Access creates embedded events and actions instead of > normal vba code to handle standard record operations on a buttonclick such > as New Record. So I am trying to use VBA. > > When I create a new record in the table, I want to validate that the info > entered is not already in the table. I could probably do this in the > BeforeInsert, but I am instead doing it on the button click. > > If the record is one which may be added I want to insert a record. I am > doing this presently by setting a dao recordset equal to the form's > recordsetclone, and then saying Rst.AddNew, and then populating a few > fields > which are not bound to controls, then using bookmark to bring the rest of > the form (and the bound controls) up to date and position the form on the > correct record. > > That part is clunky but working, but the problem is that the Current event > is not firing. For that matter, the Addnew is not firing either. > > I know I can call those events with code, but I was wondering why this > method is not causing Current to fire on its own when I set the form's > bookmark equal to the recordset's bookmark? > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com >