Hi,
I have a form with a subreport. The subreport consits entries with dates and a generated field of the week number. On the form, there are two buttons: Days and Weeks. There is also a listbox, which shows the dates/weeks depending on with button is pressed. What i would like to do is link the subreport to the main form according to the button pressed. In other words, by clicking the Days button there are VBA lines to define the linkchildfields/linkmasterfields, that is date field in subreport and listbox in main form. By clicking Weeks button, VBA clears these fields, linkchildfields/linkmasterfields, and repopulate the subreport linkchildfields with the generated week number field and the linkmasterfields with the listbox.
However thought the Days "function" works, but i can not get the Week "function" working. There is a data type mismatch error. I think i do understand why (date value passed as string), but i can not get it solved. I have tried to format the dates as string but still no success. What i do not understand that if i clear by VBA the linkchildfields/linkmasterfields with me.xxx.linkchildfields="" why it does not get reset to accept a string criterium.
Anyone can help with this?
Thank you
I have a form with a subreport. The subreport consits entries with dates and a generated field of the week number. On the form, there are two buttons: Days and Weeks. There is also a listbox, which shows the dates/weeks depending on with button is pressed. What i would like to do is link the subreport to the main form according to the button pressed. In other words, by clicking the Days button there are VBA lines to define the linkchildfields/linkmasterfields, that is date field in subreport and listbox in main form. By clicking Weeks button, VBA clears these fields, linkchildfields/linkmasterfields, and repopulate the subreport linkchildfields with the generated week number field and the linkmasterfields with the listbox.
However thought the Days "function" works, but i can not get the Week "function" working. There is a data type mismatch error. I think i do understand why (date value passed as string), but i can not get it solved. I have tried to format the dates as string but still no success. What i do not understand that if i clear by VBA the linkchildfields/linkmasterfields with me.xxx.linkchildfields="" why it does not get reset to accept a string criterium.
Anyone can help with this?
Thank you