I have just used PHV's syntax of Me.Newrecord, it seems to work evertime. Can someone confirm this is correct, thanks
If Me.NewRecord = True Then
' Do nothing
Else
DoCmd.SetWarnings False
DoCmd.RunCommand acCmdDeleteRecord
DoCmd.SetWarnings True
End If
I have a command button which terminates entering a new record being created. I put my code in where I think the record has started being created, ie the first field has data entered, its autotab is set to true and goes to the next control. Its then I hit a button with code as below. However it...
I presume you have set all your table relationships up in the relationships page.
Why not put a list of what you have in there so someone can see whats happening. ie
All relevant tables/names involved
All the tables related fields, ie show what is a Primary or Foreign key ss you just say...
Thanks PHV, yes you are correct. I have now moved the event in what was in the on exit to a save or not save button. I had a similar problem which was in a date field, if the user went to cancel the record, a dialogue box appeared saying the data entered was incorrect or words to that, so when...
In the btoon onclick event
If Me.Nameofbutton.Caption = "Active" then
Me.Nameofbutton.Caption = "Inactive"
else
Me.Nameofbutton.Caption = "Active"
end if
Have not tried it but it should work when you click it.
Thanks Joe, but I am trying to understand where that will fit in. There are two conditions of the on exit event being used. The first is normal use where the user types in some data into the text box and when he leaves the control to go to another, the textbox the on exit event does something...
Hi PHV, trust your well. Clicking a button to abort the record causes the on exit event of the textbox to happen. At this point of time the record is new when trying to abort. Also the user may be wanting the on exit function to work during a new record completion as he is eventually going to...
If a textbox memo field has an on exit event, and whilst a user is typing in data during creating a new record, how can you kill the on exit event if they hit an abort/cancel record button? Thanks
Problem solved. One of the controls had an on exit event. This was getting fired after leaving it to click abort. It all went round in a circle so now I know where the problem is I can fix it. Thanks
I have a mainform and subform. They are both bound to related tables. On the subform I have a button to create a new record. However if after typing in data I change my mind and press an abort button it leaves a blank record in my child table.
I am using:
DoCmd.SetWarnings False...
Many thanks Golam. I have been staring at the code for hours, and just noticed I had added AS Persons, StrConv(Concatenate(""SELECT Athlete FROM qselJunctionNames WHERE ID2="" & [TXCLIPS].[ID2]),3) AS NName" but had not put a comma after NName. I should have posted the whole bit that I had done...
Thanks Greg. I have a function: Hope I am not doing something wrong putting this up? Regards
Function Concatenate(pstrSQL As String, _
Optional pstrDelim As String = ", ") _
As String
'example
'tblFamily with FamID as numeric primary key...
I have a query that works okay:
mysql = "SELECT * FROM ( SELECT TOP 5 TXMASTERS.ID1, TXCLIPS.ID2, "" "" AS Persons,"
mysql = mysql & " TXCLIPS.ID2, TXCLIPS.Comments, TXCLIPS.Start AS [Time In], TXCLIPS.End AS [Time Out],"
mysql = mysql & " TXCLIPS.ID1 FROM TXMASTERS INNER JOIN TXCLIPS...
I have a mainform with a listbox. When the listbox is selected, the mainform is set to the record selected.
The mainform has a subform with a listbox on it. Its rowsource is in vb SQL code which fills the listbox with related data to the mainform.
I originally put the subforms list query in...
Cannot enable activex controls. Been into Trust settings and there is no mention of activex security settings. Clicking an activex control produces a message "Because of your security settings and current security policy, this control is disabled" Any ideas, thanks
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.