1

(7 replies, posted in Script)

sparrow wrote:

if StrToInt(FormatDateTime('d',Date))=1 or DayOfWeek(Date)=5 and form1.checkbox7.visible = true - invalid string (no brackets ()  )


if (a=b) or (a=c) then ... ; if ((a=b) or (a=c)) and (x<y) ...  if (a=b) or ((a=c) and (x<y)) ... the result depends on the correct placement of parentheses in the condition


if ((StrToInt(FormatDateTime('d',Date))=1) or (DayOfWeek(Date)=5)) and (form1.checkbox7.visible = true) - correct string
_____________________________________________________

Could you put it in the project file and then attach it ,please?
I`am a noob forgive me

2

(7 replies, posted in Script)

sparrow wrote:

StrToInt(FormatDateTime('d',Date)) - today`s day number
StrToInt(DaysInMonth(2021,10)) - last day of current month

for i := 1 to DaysInMonth(2021,10) do
  If DayOfWeek(EncodeDate(2021,10,i)) = 5 then r := r + ' ' + IntToStr(i);
Showmessage(r);
7  14  21  28

every Thursday of current month

Thanks sparrow for your reply but I`am a noob.I tried to write the code but there is an error and I don`t know how to solve it.
See my project in the attachment.
Please help

3

(7 replies, posted in Script)

derek wrote:

Use a timer to make your labels flash according to whatever condition you specify.
See the attachment (I've done it for form1.label5 (AF Supplier Deductions).
Derek.

Thanks derek for your answer but forgive me I`am a noob I don`t know how to:
-Get day of today`s date
-Get last day of current month
-Get day of every Thursday
the result should be numbers like 1,2,3,...etc
please help me

4

(7 replies, posted in Script)

Please help me

5

(7 replies, posted in Script)

Hello everybody,
Could you help me in my question ,please?
My app description: My app is about my work tasks(To do List)
Question:
I need to make label captions of specific tasks blink continuously with red color on specific days and one condition:
Task  :                 Days
-Acp attendance: 1st day of month+every Thursday
-AF Supplier’s deductions:Every 10 days (1-2-3-10-20-30)
-Casuarina:days( 10-20-last 5 days of the month)
-Take 5 together : last 3 days of the month
-Tests(Feeding-Shredding): days( 10-20-last 3 days of the month)
Condition: if the specified date is friday or Saturday,the flash should be on Sunday
See my project on the attachment
Feel free to asks any question
Please help me

Great !Thank you very much.

Thank you very much
The code repeats declaration ,opening and closing excel file.This slows down the program.
Could you please make the following modification,please?
The code should consist of:
1-General declarations
2-form load:open excel file and read data
3-button 1:writes data to excel
4-form close:closes file
see the attached picture .It Is a code-in visual basic- that I need to create one like.
https://i.ibb.co/XV7W5KK/VB.jpg
Thanks in advance

Hello Every body,
I created apost here,but I didn`t get help:
http://myvisualdatabase.com/forum/viewt … 095#p38095
Could you help me in my question,please?

I want to link my application to an excel file.or use the excel file as my database.
see examples for code that I want to create but in vba(Excel Programming languague):
1-textboxes get data from the excel file:
Example:

Textbox1.text=sheet1.range("A1")
Textbox2.text=sheet1.range("b1")
Textbox3.text=sheet1.range("c1")

2-Write data to excel file:
Example:

sheet1.range("A1")=Textbox1.text
sheet1.range("b1")=Textbox2.text
sheet1.range("c1")=Textbox3.text

and more like that.
thanks for helping

up up up

domebil wrote:

Do you want to import and export the entire database in excel?

No ,I want to get data from some cells only.
See my 3rd comment :I want to make code like it.

I saw the post but it isnot what I want.
I want to link my application to an excel file.or use the excel file as my database.
example:
textboxes get data from the excel file:
Textbox1.text=sheet1.range("A1")
Textbox2.text=sheet1.range("b1")
Textbox3.text=sheet1.range("c1")
button:(insert data to excel file)
sheet1.range("A1")=Textbox1.text
sheet1.range("b1")=Textbox2.text
sheet1.range("c1")=Textbox3.text
and more like that.
thanks for helping

Hello Everybody,
Could you help me in my question,please?
I want to Create an application that depend on an Excel file.
For Example:
I want to link my textboxes and labels with excel cells
How to do that?Is there a guide?
Thanks in advance

13

(17 replies, posted in General)

Well done Mr.ehwagner .thank you
Thank you all for helping me.This forum members is very helpful.

14

(17 replies, posted in General)

Thanks Mr. CDB .I updated the app and it works now
But I need one last modification:
the labels should always show the most recent date of the task .The labels should depend on today`s date only not datetimepicker.
Thanks in advance

15

(17 replies, posted in General)

ehwagner wrote:

No FOR LOOP is necessary as in your VB project. A simple SQL SELECT can directly access the most recent date record. Also, I'm not sure how you built the database structure. You must have done this outside of MVD because MVD requires the "id" autoincrement key field and it was missing in your database. I added it to your structure.

The app doesnot work,it shoes error in line 31
I`am sorry I didn`t see your post.
I wan My app to do the following:
Add mode: by choosing the date (datetimepicker) then tick the checkboxes then press save button
Show mode:the labels should always show the most recent date of the task .The labels should not depend on datetimepicker or any other thing..
Note:datetimepicker is used only in add mode
Thanks in advance

16

(17 replies, posted in General)

CDB wrote:

3. By selecting previous dates from the date time picker you can bring up previous checklist results. As you select previous dates, the data for the ROW corresponding to the date selected is read from the database and the boolean results for each checkbox column (in the database) are shown against each checkbox with a label changing colour, depending on the date taken from the Date column in the database..

Is that what you are hoping to achieve?

You are right but no3 is wrong:
-I want the labels to show only last date of the task .And I don`t want to create datetimepicker next to each checkbox.
-By selecting an old date-like new date-I can add tasks it it .
See the picture in post no.5,this is my database.I want it as it is with no change.
Like I said before,I want this vb script to use in my current project and future ones also.
Thanks in davance

17

(17 replies, posted in General)

Thank you mr. CDB for your reply
I will answer your questions:
1-I want the databse to store the completion of my tasks. Everyday is stored in a single row like in my file in first thread.
2-If I choose an older date then I click save, all data is saved to this date
The script:I have a question for you, please
-I want it to get the data from the databse not from a new table grid, please
-Then apply the final script to my project in first thread and post it here.

This script- that I want - will help me so much in creating all my future programs.
Thanks in advance for your great help

18

(17 replies, posted in General)

ehwagner wrote:

leprince2007,
My apology for not fully understanding your requirements. It sounds like Derek's solution may be closer to what you want then. Try it out and see.

Mr Derek changed completely the design of my app and this isn't what I want.
I need from you to work on my project in the first post.
This what I want but in vba script (vba is used in office apps) :

Datacolumn=checkbox.Caption    'column name in database
For row=Datacolumn.Rows.Count to 0 step - 1.   ' search from the last record to the first record 
If cells(row, Datacolumn) >1 then.    Look for the last value >1
Label1. Caption=cells(row, datecolumn).Value
Exit for
End if
Next

Could you convert it to work in myvisual database , please?

19

(17 replies, posted in General)

ehwagner wrote:

leprince2007 and Derek,
I was trying to get my hands around leprince2007's design for some of the same reasons you gave Derek. I made some assumptions which sometimes one has to do on some forum requests. Since he only wants to know the last date the task was performed and not necessarily wanting a history of the tasks and that one or more of these tasks are done daily,.

Thank you Mr.ehwagner and Mr.derek for your replies but I want my app design like it is.
You did things in my app that I don`t want:
1-The app saves my last marked check-boxes
2-the app overwrites data in the database
3-a lot of datepickers are created
4-You hid my datepicker "Dttoday"
I will explain again what my app does:
1-I choose a date from the data picker in the top "Dttoday".Note I can choose any date
2-I tick on check-boxes when I complete the tasks
3-I click save button to save the data (date and check-boxes ) to the database
I want to show the last date of the task in the label next to the task
I hope you understand me and help me
See my database in the picture

20

(17 replies, posted in General)

Hello Everybody,
Could you help me in my question,please?
I created a program for my work tasks.Every checkbox is a task and has a column in my database..
If I finished a task ,I click on its checkbox and it returns 1 in the database(If I click save button).
My question:
-There is a label next to every task.
First :I want the labels to show the last date in which I did this task (last "1" value).
Second:If the date in each label is yesterday,It`s font color changes to green.and if the date in each label is older than yesterday,It`s font color changes to red.
I want all this happens when the Form loads.
I`am sorry I`am a beginner.
Thanks in advance