Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

This topic is 6984 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted (edited)

Well after spending an hour or so browsing through these posts, in the words of U2 "I still havent found what im looking for".

I am a complete novice at this and maybe this idea is a little over my head, but i am giving it a try.

I have 3 questions,

1) I need a script which takes the current date which i have in one field, and automatically calculates another date. The first instance for this is to calcualte a date which is exactly 1 year from the current date (membership renewals) with the ability to remind me when the membership is due. the second instance is to work out a date which is calcualted from the current date but is a factor of a time i enter in another box, ie 6 weeks.

2) I am trying to have a birthday finder which puts the most recent at the top of a list, but it always searches by year, i dont want that, i want the month and day. Ideally i would like a window to pop up to tell me when it is someones birthday in 5 days time.

3) The final thing is to calculate a bar code number, (i have a programme to generate the codes), but i need this reflected in the database. the codes appear as follows MC0000001 the digit on the end is the client number for example, the MC is a generic code. So client 125 would be MC0000125. This i have tried to do myself but i cant get the leading zeros to work. Once i have the number in a field I normally insert a picture which is the bar code itself into a container, is there a way to do this manually, so the bar code number ties up with the appropriate bar code?

Am i asking too much, just tell me to go away and find a programmer and spend some money if you like, But any help would be appreciated from this poor teacher in France.

thanks

Jules

Edited by Guest
Posted (edited)

I'm sure there are a number of answers to your questions. I just make a few suggestions.

1. Use a calculation for the Renewal, suppose your date is called start.

Renewal = Date(month(start);Day(start);Year(start) + 1)

(Of course this fails if the start date is 29th Feb in a leap year. In those circumstances give them the extra day and call start 1st March).

To add from a field AddDays which should be a number of days

NewDate = OldDate + AddDays.

2. If you want to ignore the Year then it is probably best to store the birthday as text in digits mm/dd. If you want to work with this as a date (in the current Year) then use

Date(mm;dd;Year(Get(CurrentDate)).

{EDIT} missed the pop-up. In your startup script check for birthdays in 5 days and put up a message if there is one. Or possibly run a search, I don't know how many you might find. You probably need a test something like

If(Get(CurrentDate) = Date(mm;dd;Year(Get(CurrentDate)) - 5)

"show a message"

End if

3. You are looking for a 7-digit "number" with leading zeros where appropriate at the end of your barcode. This has to be text. Use the formula

"MC" & Right("0000000" & ClientNumber;7)

Edited by Guest
Posted

[color:red]Thanks SlimJim

But i cant get them to work... keep giving me errors... Yes i know i am stupid but we all got to start somewehre...

[color:red]For the renewal I have a field called Start so i used

Renewal = Start(month(start);Day(start);Year(start) + 1)

[color:red]

This tells me that Either an Operator was ommited, this function cannot be found, or"(" was expected here. And then highlights the Word Start at the beginning

2. If you want to ignore the Year then it is probably best to store the birthday as text in digits mm/dd. If you want to work with this as a date (in the current Year) then use

Date(mm;dd;Year(Get(CurrentDate)).

{EDIT} missed the pop-up. In your startup script check for birthdays in 5 days and put up a message if there is one. Or possibly run a search, I don't know how many you might find. You probably need a test something like

If(Get(CurrentDate) = Date(mm;dd;Year(Get(CurrentDate)) - 5)

"show a message"

End if

[color:red]

I tired this too, and cant find how to enter this into the script, there is no Get in my pulldown menu in the scriptmaker and when i sepcify it i get the error "Either an Operator was ommited, this function cannot be found, or"(" was expected here. And then highlights the Word Get at the beginning

3. You are looking for a 7-digit "number" with leading zeros where appropriate at the end of your barcode. This has to be text. Use the formula

"MC" & Right("0000000" & ClientNumber;7)

[color:red]And this one... tells me it cant findthe field ClientNumber;7

Posted

I got one more to 2 work..

you told me "MC" & Right("0000000" & ID;7)

i did "MC" & Right("0000000" & ID,7)

big difference between a comma and semi colon

thanks again

Posted

My apologies.

I failed to take account of the fact that you were using FMPv6. In v7 the semi-colon is used as a separator whereas in v6 it is a comma. All the semi-colon separators in the formulae should be replaced with commas.

Posted

YOU mean if i upgrade i will have to relearn it all !!! : Thanks for your help.. I am still struggling a bit with the birthday thing....

What i would like it to do is run at startup and look through all the records and then open a layout which lists all the birthdays which will happen in the following week.

I have been trying to make it work with

IF (Month(today) and Day(today) = Month(DOB) and Day (DOB-7))

This topic is 6984 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.