Delete Button

coolcatkelso

Registered User.
Local time
Today, 21:46
Joined
Jan 5, 2009
Messages
279
Hiya guys

Can I have a button on the main menu of my form in Demo Called (Register Serial) and lets say something like - Delete Button from form Demo if module renamed to basFirstRun1 instead of basFirstRun?

That way, when the Dbase is in Full Mode not Demo the button will be removed
________
How To Use A Vaporite Solo
 
Last edited:
ok bob cheers

I assume it would be some sort of docmd.HideButton IF basRunFirst name change to basRunFirst1 lol ?

Not that good
at Dbase
________
Geo/Chevrolet Tracker History
 
Last edited:
Just set it's Visible property to NO in design view and then set it to be visible on your first run and from then on out it will still be in invisible.

Also, I notice you are trying to do all of this renaming and deleting and all sorts of stuff. WHY? Why go through all of that? You won't be able to use an MDE or ACCDE file and you won't be able to use the Access Runtime. Everyone who uses your database will need the full version of Access to use it and they will be able to get to your objects.
 
Hiya Bob

Yip your right, I made the Accde last night but never had a chance to check it, and error for renaming

The reason for it is because, The Dbase starts in Demo mode using TblDateFlagged and Module - basFirstRun (Counts the days etc)

When you enter a serial number, the Dbase then Renames the tblDateFlagged to tblDateFlaggedOLD and same with the Module and renames a few other ones like In demo mode you have Autoexec,, and TEMPAutoexec is for the full version.. So again, Enter Serial number and you rename Autoexec to AutoexecOLD and Rename TEMPAutoexec to Autoexec

Then this all becomes the Full version

I thought about just deleting the TblDateFlagged but that would cause errors as the module wont be able to find it..

Don't know how else I could do it

You have any IDeas?

I've included the basic Demo to Full version, its all pretty simple and straight forward to use.. Its in Access 97 - Access 2002
________
Dc marijuana dispensaries
 

Attachments

Last edited:
are you still struggling with this cool cat? i'm thinking about making you an example so we can get rid of all your threads. :D
 
1. if you want to be able to create an MDE or ACCDE file (so you can compile your code and make it very difficult for people to get to the code), you can't delete or rename objects.

2. So, I would suggest using custom properties instead for certain things. And then you can set a flag, for example, which you can check when you want to use something you can use one object if the flag hasn't been set and another if it has.

See here for how to use the custom database properties.

That way you don't have to delete or rename things and can protect your code much better as well.
 
lol Adam thanks man

Cheers bob I'll have a read through it tonight

Did you manage to have a look at the attachment I posted?

Because its A Demo Dbase and able to reg into full, I have to hide the code other wise I may as well just do with the demo part

I understand what you mean by flagging something so it changes but don't think that would work with the current Setup I have.

Maybe another way I could look at this is - Instead of having the Trial set by tblDateFlagged and the module.. Maybe I could have a limit to the number of times the Dbase opens or just limit the Add new record?

Then I wouln't need to Delete or rename a module?

and instead of renaming tables, I could see if I can copy details from one table to another? Would all this work with accde?
________
Weed Vaporizers
 
Last edited:
lol Adam thanks man

Cheers bob I'll have a read through it tonight

Did you manage to have a look at the attachment I posted?
Yes, I did.
Because its A Demo Dbase and able to reg into full, I have to hide the code other wise I may as well just do with the demo part
No, you don't need to "hide" the code, you just need to compile to an MDE file and nobody is getting in to see it.
I understand what you mean by flagging something so it changes but don't think that would work with the current Setup I have.
It will work with the setup you have as long as you modify it so it is not dependent upon deleting or renaming things.
Maybe another way I could look at this is - Instead of having the Trial set by tblDateFlagged and the module.. Maybe I could have a limit to the number of times the Dbase opens or just limit the Add new record?
You can flag it in the database properties (no need for the table) and there is no need to have a separate module. You can conditionally run code based on the flag. I don't seem to be getting through to you that you do not need separate objects to accomplish this. You use ONE set of objects and you either display or hide stuff based on your flags (which can be in the database properties).
Then I wouln't need to Delete or rename a module?
No, you wouldn't.
and instead of renaming tables, I could see if I can copy details from one table to another? Would all this work with accde?
Why copy details from one table to another? You can use the same table.
 
ok Bob

I'll go with your idea, but can you explain exactly what I need to do? As I've said before, I'm not that advance with Dbase

Or I can send you a copy of what I got just now for you too look at, but it would have to be sent private as its too big for here

Cheers

Harry
________
TOYOTA CARINA ED SPECIFICATIONS
 
Last edited:
What you will want to do is go to the link I gave in one of my previous posts which takes you to Allen Browne's website and there is code you can pop in a standard module which will create a custom property, and then update and read one. You only create the property once, so that is probably a manual thing you do (just run the code from the Immediate window). Once that is in place (and you can use any number of custom properties) you can then read and write them as necessary using that code.
 
HIya bob

I assume its this code


There have been quite a few people on the comp.databases.ms-access newsgroup asking if you can reset a counter to zero. Briefly, not really. If you need as serial number or usage count that persists after the database is closed, a good way is to use a property named "SerialNo". As before,

Code:
Function Tmp()
        Dim DB As Database
        Set DB = DBEngine(0)(0)
        DB.properties.Append DB.CreateProperty("SerialNo", DB_LONG, 0)
    End Function
And run it once from the immediate window. You then need one or two functions to access it
    Function CurrSerial() as Long        Dim DB as DataBase        Set DB = DBengine(0)(0)        CurrSerial = DB.properties!SerialNo    End Function    Function NextSerial() as Long        Dim DB as DataBase        Set DB = DBengine(0)(0)        DB.properties!SerialNo = DB.properties!SerialNo + 1        NextSerial = DB.properties!SerialNo    End Function    Sub ResetSerial()        Dim DB as DataBase        Set DB = DBengine(0)(0)        DB.properties!SerialNo = 0    End Sub
________
Public Auto Insurance Forum
 
Last edited:
So, I Create a new module (tmp) and add this line

Code:
Function Tmp()
        Dim DB As Database
        Set DB = DBEngine(0)(0)
        DB.properties.Append DB.CreateProperty("SerialNo", DB_LONG, 0)
    End Function

And run it once from the immediate window. You then need one or two functions to access it

The what do I do with these parts?

Code:
Function CurrSerial() as Long
        Dim DB as DataBase
        Set DB = DBengine(0)(0)
        CurrSerial = DB.properties!SerialNo
    End Function

Code:
Function NextSerial() as Long
        Dim DB as DataBase
        Set DB = DBengine(0)(0)
        DB.properties!SerialNo = DB.properties!SerialNo + 1
        NextSerial = DB.properties!SerialNo
    End Function

Code:
Sub ResetSerial()
        Dim DB as DataBase
        Set DB = DBengine(0)(0)
        DB.properties!SerialNo = 0
    End Sub

and I just delete the tblDateFlagged etc etc from my Dbase
________
Amateur xxx video
 
Last edited:
So, I Create a new module (tmp) and add this line

Code:
Function Tmp()
        Dim DB As Database
        Set DB = DBEngine(0)(0)
        DB.properties.Append DB.CreateProperty("SerialNo", DB_LONG, 0)
    End Function

And run it once from the immediate window. You then need one or two functions to access it
Yes, you only need to do it once (in fact you'll get an error if you try to append a property that already exists).
The what do I do with these parts?

Code:
Function CurrSerial() as Long
        Dim DB as DataBase
        Set DB = DBengine(0)(0)
        CurrSerial = DB.properties!SerialNo
    End Function
^^^^^^^^^ that one used to set the serial number whenever you do.
Code:
Function NextSerial() as Long
        Dim DB as DataBase
        Set DB = DBengine(0)(0)
        DB.properties!SerialNo = DB.properties!SerialNo + 1
        NextSerial = DB.properties!SerialNo
    End Function
^^^^^^^^^ that one is a mystery to me - why you would increment your serial number is a mystery to me.
Code:
Sub ResetSerial()
        Dim DB as DataBase
        Set DB = DBengine(0)(0)
        DB.properties!SerialNo = 0
    End Sub
^^^^^^^^ and that one would be to reset it when the trial expired, etc.
and I just delete the tblDateFlagged etc etc from my Dbase
Yep, I believe so. And then you base your code for running things on whatever properties you've set. That way you can have ONE code set and objects but display and do things based on your properties.
 
Ok thanks for that Bob

Will give it a bash tomoz... So this is only the serial part? What do I need to set the trial period?
________
Half-Baked
 
Last edited:
Hiya Bob

I've created the 3 modules now, so I got Temp, Serial and Reset.. I ran the temp module once, and now got no idea what I'm doing lol Sorry
________
Toyota Ipsum Specifications
 
Last edited:
Well, let's see. For example, if you want certain code to run when it is a trial version, you would use the GetProperty to first get the property you want to compare and then use an IF -
Code:
If GetProperty("Whatever") = "Whatever" Then
... do whatever
Else
... do whatever if it isn't
End If

Same thing when opening forms, or any other operation.
 

Users who are viewing this thread

Back
Top Bottom