Hi everybody i am new to vb.net programing and i am developing gym application and i need help in coding
in a form i an giving the joining date of a customer and with membership duration and
the thing i need is if select 30days membership then expiry date to be generated from joining date with type of membership (i.e month,quartly,half-yearly,yearly) like that
can anyone help plzzzzzz

Thanks is advance

Hi,

You can find an example, here.

i need is if select 30days membership then expiry date to be generated from joining date with type of membership (i.e month,quartly,half-yearly,yearly)

Can you please say some more about this type of membership(month, quarty, half-yearly, yearly)? What are they suppose to meanm I mean what is their purpose in here?

There should be 2 fields in the database.

1) Date_of_join
2) Date_of_Expiry

1 Combobox for time period
2 Datetimepickers
First one for date of joining you will select
Second for date of expiry (readonly) autogenrated.

Suppose Combobox value is 30 Days

do the following on the value change event of the datetimepicker 1

datetimepicker2.value=DateTimePicker1.Value.AddDays(comboBox1.SelectedValue)

Insert into the database

Next time check

if datetime.now > Date_of_Expiry
Subscription Expired
Exit sub


I hope you get the logic.

datetimepicker2.value=DateTimePicker1.Value.AddDays(comboBox1.SelectedValue)

I believe the .SelectedValue would need to be converted from string to int first for that line to work?

Hi Mikey,

I think you answer doesn't going to have any effect because this thread is 1 year old.

Oh sugar didnt notice that, /palm.

Was just pinging through related articles lol.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.