Thank you so much for your help I have all of the info to make it work I just need to work through it and understand it much better and that’s something that may take a while but I’m always pleased to learn.
I appreciate the value in knowing how to refer to subform items and this is a case of not knowing what I didn’t know until it came up. I thought I had a basic idea but sadly it’s way too basic for what I’m trying to...
User Profile
Collapse
-
Thanks for your replies, I don’t know if I explained my situation at all well and I’m sorry for that
The forms are set up like so
Client 1
Client 1 Programme 1 Client 1programme 2 Etc
Programme 1 record 1 Programme 1 record 2 Etc.
So If I use a button on click on the child form I can filter for a specific client and see ALL of their programmes (My main report is called “rpt_ProgTop”)...Leave a comment:
-
Filtering a report from a sub form
I have a continuous sub form in the footer of a single form which is itself a sub form to my main form. It is set up this way because one client can have many programmes and each programme can have many components.
I have a report set up to view everything but I am lost as to how to filter the report so that I can print only the programme I am viewing in the form. I would like a button on the first sub to open the report to preview... -
Double checked my SQL and there was indeed an error. I am still at a loss as to why a query that was happy for 2 or 3 years would decide to stop behaving but using dateadd is doing the job nicely so I wont worry :)
Thank you so much for your help it is much appreciated.Leave a comment:
-
Thanks for your reply.
"[Att_Date]" is a date/time field in the table
All the queries are in the front end, only tables sit on my back end.
Removing the datevalue() function and using Dateadd in the criteria stops the error but returns 0 records, have I misunderstood?
Thanks for your help.Leave a comment:
-
Data Type Mismatch In Query
I have 2 queries which have been working for the last 2 or 3 years but last week decided to start giving me a data type mismatch error. Query 1 looks at how many records have been created in the last 31 days so that I can count visits, and query 2 looks at how many visits I have each day (Today)
I rewrote the queries and they worked for a few hours and then fell over again. I have tried to compact and repair but that hasn't changed anything....Last edited by zmbd; Feb 24 '14, 01:10 PM. Reason: [z{Placed required code tags, stepped SQl for easier reading}] -
Had a look and I can't find anything which sheds any light on the problem. Tried searching the internet again and found nothing that helps there either. Maybe it just can't be used in a subform? Maybe time for me to look at an alternative method? Thanks for your Help Rabbit I appreciate your time and input.Leave a comment:
-
I actually found it on this forum in another post. It suggested using =RowNum([Forms]![MyFormName])in an unbound textbox to number records, and that's about all I know about it. Works a treat until the form becomes a sub form. Certainly if you type rownum into the control source box in the textbox properties it appears as an autocomplete option as a function. Does that shed any light?Leave a comment:
-
Without using [Forms]![FormName] the RowNum function doesn't work even on a straight form. I have tried various combinations to get it to work but usually when referencing a subform control I do it from the main form and I can't get my head around calling a subform control from the very subform control I am calling. Doesn't feel like it could work, but I am really not much good with VBA so my feeling really doesn't count for very much. Sorry if I...Leave a comment:
-
Thanks for the reply, I am not sure how to do that. I have tried putting the following code as the control source for the unbound textbox on the subform.
=RowNum([Forms]![MainFormName]![SubformName]) but am getting the same #type error
If I add the textbox name =RowNum([Forms]![MainFormName]![SubformName].[textbox] I get a #name? error.
I appreciate that I am missing something obvious and/or doing something daft but if you could...Leave a comment:
-
Numbering records on a form
I have a query which returns a list of 5 records at random and have been looking for a way to number these records 1 to 5 simply as a visual aid to users. I used the following code in an unbound text box on my form: =RowNum([Forms]![MyFormName]) and everything worked. Then I used this form as a subform and now get a #Type! error. I thought it would work since the code is contained in the sub form rather than being referred to from the main form but... -
-
Expression Entered Refers to Object that is Closed or Doesn't Exist
This piece of code was working untill today, I now get runtime error code 2457 ("The expression you entered refers to an object that is closed or doesn't exist")
Here is the code I am using with the offending line underlined in bold. If this line fails I don't see why the first if statement doesn't also fail?
If anyone can help I would very much appreciate it.
Thanks
Client_Ref... -
I tried the code exactly as posted and then quoted out those lines to see if it made any difference. With the lines in, the code always evaluates to true. Quoted out it always evaluates to Not True.Leave a comment:
-
Sorry I should have explained that bit. text188 is just a box I added to see if I could get this bit of code working before integrating it with my booking system. I am using its onupdate event as a means of testing my code easily. The box contains no relevant information and in the finished database will not be there.Leave a comment:
-
Hi ADezil and thanks for your help on this. I am using the code exactly as you posted it except that I quoted out lines 5 and 6 (Although I tried with the lines in). I am using it in the on update event of a textbox So it looks like this..
Private Sub Text188_AfterUp date()
Dim dteDate As Date
Dim dteTime As Date
'Will evaluate to True
'dteDate = #1/17/2011# 'Monday
'dteTime...Leave a comment:
-
Thanks for your reply. I can't work out why, but the above code always evaluates to NOT true and so the out of range msgbox is displayed? It is Monday today and I have set the first time variable (on line 14.) to 11:30 AM to ensure that the current time (1:45 pm) is in range to test everything. Am I being daft and missing something?
ThanksLeave a comment:
-
Using the And function
I would like a message box to display if one of my reception staff tries to check a customer in on a Monday or a Thursday between 15:30 and 17:30.
So I typed my times into excel and formatted the cell as a number to see how it was stored and then used those numbers in the following hoping that if it worked for one day I could simply add another if statement for the other day;
If Weekday(Date) =6 And Time() > 0.6458333333333 33... -
I have fixed it. The pk autonumber just wasn't working in the Gen_Users table, so...... I created a new database and imported the Gen_Users table structure into it. I then imported the information by appending it to the new table in the new database. I then imported that new table from the new database into the original database which gives me a brand new working table. Deleted the old Gen_Users table, renamed the new table to Gen_Users and the pk...Leave a comment:
-
Thanks guys. My pk autonumbers are set to long integer and increment. Compact and repair does not fix the problem.Leave a comment:
No activity results to display
Show More
Leave a comment: