How to make cmd buttons (undo & clear) work on subforms
Specifically the Undo doesn't undo the subforms, just the Main form. I also am not sure how to make my clear button, clear out all controls on all 3 forms.
Thank you for taking the time to report an issue.
What's wrong... Please write below.
it goes like this :
I have 2 reports and one form for example
on the 2 reports I have a command buttons that opens another form that contains the record values
when I view the report separately the button work.
when I put it in the main form as a sub forms the buttons suddenly pops up a parameter missing alert box ( I mean the one you can fill the value and hit ok)
the event of the buttons is onClick macro
where [reports]![name of report][name of field]=so on.
hope I'm clear on my questions and that for you guys it's a kinder garden question!
sorry about the english . it's not my native!
hope to hear good news
I have a table "Master" & tables "A" & "B"
A & B are actually the main tables with thousands of records.
Master is a selection of either A or B on Todays Date, 20 or so records.
Master has a Link ID to A
Master has a Link ID to B
A & B are not related
Is there a way to set up a single query that shows all the records
where Master has a matching A & Master has a matching B
If I link Master to both tables ID of course there is no match throughout all the tables.
Don't want them on seperate subforms
I don't think I have made that very clear but hopefully get the gist
If MsgBox("Are you sure you would like to delete History" & _ " from this record only", vbQuestion + vbYesNo,= vbYes Then
Dim cmd As ADODB.Command
Set cmd = New ADODB.Command
cmd.ActiveConnection = CurrentProject.Connection
cmd.CommandText = "DELETE FROM tblPre WHERE Number = '" & Me.[Ratio Number] & "'"
Me.Refresh Else End If
clearing the records in a form and presenting a fresh form for data entry for the user. I have a form which contains a few subforms. After data is
entered I need to clear the fields for new data entry, so I tried the
above code and it dosent seem to work. Is it because I am trying to clear
the records of the subform from the main form? Is there a way around
this? I really need to have the form holding all the subforms.
To me Microsoft has it backwards. I have to Save the File, then make a change, then undo it, then save it again. before the Esc and Undo cannot lose my work for me. They should haveREVERSED this process and made recovery take 4-5 steps not saving (which I do when entering technical & difficult data about every 60 seconds.
The other problem is every time I save data (large text fields) the cursor goes to the top of the field and I find only Top or Bottom choices available. The amount of time I spend saving(for sure) and getting back to where I was takes nearly as long as the data I enter between each save : ( is anyone else having this problem?
So what I'm asking is a way to save the Access file without Esc or Undo messing it up, and how to get the cursor back where it was at the time of the save. I'm guessing a macro may do itbut I'm not familiar with the vb code stuff people talk about.
I have a Access Navigation form, with subforms within each 'button' one of these buttons is called 'Treatment Menu' (NavigationButton19)
On the 'Treatment Menu' subform (called 'NavigationSubform' by default) I have some cmd buttons to open the relevant user forms. when any of the buttons are clicked the relevent user form opens and the Navigation form closes.
On the current open user form I have put in a cmd button called 'Return' - which is where the problem is.
Is there a way I can return to the Navigation form to the same point that I came from - in this case the 'Treatment Menu' subform?
I have tried using Docmd and Forms! ect ect but nothing seems to be working
On opening the form the cmd button (View Reports) is disabled. The user enters dates in the Start and End date boxes, once this is done the cmd button enables.
However if they decide to clear the dates (using another cmd button 'clear Dates') then I need the View Reports button to go back to being disabled.
I have tried the following on lost focus, on change ect but noting seems to work!
'Enables Cmd View Report if dates have been entered
If Me.txtDateStart.Value = "" And Me.txtDateEnd.Value = "" Then
Me.cmdViewReport.Enabled = False
Me.cmdViewReport.Enabled = True
I would like to make that check be done in a function. The problem is that what needs done in the If False portion is different for the two buttons.
btnRefresh will requery a subform and btnPrintReport will open a report.
Should I attempt to use only one form w/ VBA to enable/disable all the buttons depending on access level or just stick w/ my current plan and make 3 seperate forms, one for each level
Dim strQueryText As String
cmd.ActiveConnection = CurrentProject.Connection
cmd.CommandType = adCmdText
strQueryText = "SELECT Store_Profile.SPStoreNo, Store_Profile.SPSiteNo, Contact_Profile.CPExtAcctPhoneNo, Contact_Profile.CPExtAcctFaxNo"
strQueryText = strQueryText & "FROM Contact_Profile INNER JOIN Store_Profile ON Contact_Profile.SPStoreNo=Store_Profile.SPStoreNo" & ";"
cmd.CommandText = strQueryText