Kamis, 02 Januari 2014

[MS_AccessPros] On a new record TransactionID should give next higher value if any previous record is deleted

 

Hi All,

I have a form on which i had a field "TransactionID" as AutoNumber, set as key. I was having problems if a record was deleted from button on form OR Undo from a button and then adding new record it was new TransactionID.
That is if TransactionID = 4 deleted or Undo, for new record i do not get TransactionID = 4, but get TransactionID = 5

I read on a forum the following, but i am not sure where to put this code, and also would it work or not. Could somebody help.

Khalid

Change your field from an autonumber to long integer and use the following code on your add record forms.

Code:
Dim varID As Variant         If IsNothing(YourID) Then          ' Get the previous high number and add 1          VarID = DMax("YourFieldname", "YourTableName") + 1          ' If this is first one, then value will be null           If IsNull(YourID) Then YourID = 1                FieldID = VarID       End If

__._,_.___
Reply via web post Reply to sender Reply to group Start a New Topic Messages in this topic (1)
Recent Activity:
.

__,_._,___

[MS_AccessPros] (unknown)

 

Hi All,

I have a form on which i had a field "TransactionID" as AutoNumber, set as key. I was having problems if a record was deleted from button on form OR Undo from a button and then adding new record it was new TransactionID.
That is if TransactionID = 4 deleted or Undo, for new record i do not get TransactionID = 4, but get TransactionID = 5

I read on a forum the following, but i am not sure where to put this code, and also would it work or not. Could somebody help.

Khalid

Change your field from an autonumber to long integer and use the following code on your add record forms.

Code:
Dim varID As Variant         If IsNothing(YourID) Then          ' Get the previous high number and add 1          VarID = DMax("YourFieldname", "YourTableName") + 1          ' If this is first one, then value will be null           If IsNull(YourID) Then YourID = 1                FieldID = VarID       End If

__._,_.___
Reply via web post Reply to sender Reply to group Start a New Topic Messages in this topic (1)
Recent Activity:
.

__,_._,___

Rabu, 01 Januari 2014

[AccessDevelopers] File - Monthly_Notices.txt

 


Monthly notices:

Hi Kids!:

Don't forget to check out our "Links" section at the website for helpful sites. Also take a peek at books that others have found worthwhile in our books database under the 'Database' link of the main AccessDevelopers page. Feel free to add any books or links that you have found useful.

__._,_.___
Reply via web post Reply to sender Reply to group Start a New Topic Messages in this topic (114)
Recent Activity:

Please zip all files prior to uploading to Files section.
.

__,_._,___

Re: [MS_AccessPros] SQL backend and Access Front end

 

Duane

Thank You. I asked a sql guy several months ago about a similar situation and he told me that opening a sql file is not portable.
I will give it a try and see if it works


Jim Wagner

Sent from Yahoo! Mail for Windows 8

From: Duane Hookomduanehookom@hotmail.com>
Sent: ‎Wed, ‎Jan‎ ‎1‎, ‎2014 at ‎11‎:‎27‎ ‎AM
To: Access Professionals Yahoo Group ms_access_professionals@yahoogroups.com>
Subject: RE: [MS_AccessPros] SQL backend and Access Front end

Hi Jim,

You don't "open" a sql file from Access. You link to the tables and views from the SQL database. The SQL databases are typically one or more files on your hard drive. When you create a new SQL database, you have the option of specifying where you want to create the database and transaction log files. I believe this could be on a usb drive.

When I want to move a database to a new server or different folder, I first detach the database, move it, and reattach at its new location.

All of this is managed through SQL Server Management Studio. There are probably utilities that allow you to keep databases synchronized across multiple locations. If you want to use the USB drive, I expect it would need to have the same drive letter for your desktop and laptop.

Duane Hookom MVP
MS Access

________________________________
> From: luvmymelody@yahoo.com
>
> Hello all,
>
> I have a question about front ends and backends.
>
> I tried a couple of months ago this scenario.
>
> I have sql express on my work desktop. I tried to open the sql file on
> my work laptop and it did not recognize the file in sql express. I was
> wondering if there was a way to make this file portable so that I can
> create a front end and keep it on a usb drive to the sql file on the
> usb drive? I have a personal task database that I would like to learn
> to use sql as the back end and access as the front end.
>
> Thank You
>
> Jim Wagner

__._,_.___
Reply via web post Reply to sender Reply to group Start a New Topic Messages in this topic (3)
Recent Activity:
.

__,_._,___

Re: [MS_AccessPros] Starting a new topic

 

Thanks John, I will do that from now on.

Jim Wagner


Sent from Yahoo! Mail for Windows 8

From: John ViescasJohnV@msn.com>
Sent: ‎Wed, ‎Jan‎ ‎1‎, ‎2014 at ‎2‎:‎45‎ ‎PM
To: MS_Access_Professionals@yahoogroups.com>
Subject: [MS_AccessPros] Starting a new topic

Jim-


The web interface is a disaster. Just send an email to MS_Access_Professionals@yahoogroups.com with whatever subject you want to start a new topic. (Like I did with this email.)

John Viescas, Author
Microsoft Access 2010 Inside Out
Microsoft Access 2007 Inside Out
Microsoft Access 2003 Inside Out
Building Microsoft Access Applications
SQL Queries for Mere Mortals
(Paris, France)




On Jan 1, 2014, at 4:22 PM, Jim Wagner luvmymelody@yahoo.com> wrote:

Is anyone else having issues with starting a new topic? I click the button until it is not fun anymore.

Jim Wagner


Sent from Yahoo! Mail for Windows 8

From: Thomas Ewaldtewald@yahoo.com>
Sent: ‎Sun, ‎Dec‎ ‎29‎, ‎2013 at ‎7‎:‎06‎ ‎AM
To: MS_Access_Professionals@yahoogroups.com MS_Access_Professionals@yahoogroups.com>
Subject: Re: [MS_AccessPros] help with a trimming a string



__._,_.___
Reply via web post Reply to sender Reply to group Start a New Topic Messages in this topic (7)
Recent Activity:
.

__,_._,___

[MS_AccessPros] Starting a new topic

 

Jim-


The web interface is a disaster.  Just send an email to MS_Access_Professionals@yahoogroups.com with whatever subject you want to start a new topic.  (Like I did with this email.)

John Viescas, Author
Microsoft Access 2010 Inside Out
Microsoft Access 2007 Inside Out
Microsoft Access 2003 Inside Out
Building Microsoft Access Applications 
SQL Queries for Mere Mortals 
(Paris, France)




On Jan 1, 2014, at 4:22 PM, Jim Wagner <luvmymelody@yahoo.com> wrote:

Is anyone else having issues with starting a new topic? I click the button until it is not fun anymore.

Jim Wagner


Sent from Yahoo! Mail for Windows 8

From: Thomas Ewald<tewald@yahoo.com>
Sent: ‎Sun, ‎Dec‎ ‎29‎, ‎2013 at ‎7‎:‎06‎ ‎AM
To: MS_Access_Professionals@yahoogroups.com <MS_Access_Professionals@yahoogroups.com>
Subject: Re: [MS_AccessPros] help with a trimming a string



__._,_.___
Reply via web post Reply to sender Reply to group Start a New Topic Messages in this topic (6)
Recent Activity:
.

__,_._,___

RE: [MS_AccessPros] SQL backend and Access Front end

 

Hi Jim,

You don't "open" a sql file from Access. You link to the tables and views from the SQL database. The SQL databases are typically one or more files on your hard drive. When you create a new SQL database, you have the option of specifying where you want to create the database and transaction log files. I believe this could be on a usb drive. 

When I want to move a database to a new server or different folder, I first detach the database, move it, and reattach at its new location.

All of this is managed through SQL Server Management Studio. There are probably utilities that allow you to keep databases synchronized across multiple locations. If you want to use the USB drive, I expect it would need to have the same drive letter for your desktop and laptop.

Duane Hookom MVP
MS Access

________________________________
> From: luvmymelody@yahoo.com
>
> Hello all,
>
> I have a question about front ends and backends.
>
> I tried a couple of months ago this scenario.
>
> I have sql express on my work desktop. I tried to open the sql file on
> my work laptop and it did not recognize the file in sql express. I was
> wondering if there was a way to make this file portable so that I can
> create a front end and keep it on a usb drive to the sql file on the
> usb drive? I have a personal task database that I would like to learn
> to use sql as the back end and access as the front end.
>
> Thank You
>
> Jim Wagner

__._,_.___
Reply via web post Reply to sender Reply to group Start a New Topic Messages in this topic (2)
Recent Activity:
.

__,_._,___